planning plana

This commit is contained in:
amazuecos
2025-03-29 11:07:36 +01:00
parent 47455cd9c2
commit 8c64b678fe
28 changed files with 655 additions and 209 deletions

View File

@ -61,9 +61,9 @@ class OrdenTrabajoDate extends Model
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = [];
protected $afterInsert = ["updateOrdenTrabajoUser"];
protected $afterInsert = [];
protected $beforeUpdate = [];
protected $afterUpdate = ["updateOrdenTrabajoUser"];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
@ -102,7 +102,7 @@ class OrdenTrabajoDate extends Model
}
return $data;
}
protected function updateUserDateMap($data,$values){
public function updateUserDateMap($orden_trabajo_id,$data){
$mapping = [
"fecha_encuadernado_at" => "encuadernacion_user_id",
// "fecha_externo_at" => "null",
@ -121,10 +121,10 @@ class OrdenTrabajoDate extends Model
];
$otUser = model(OrdenTrabajoUser::class);
$auth_user_id = auth()->user()->id;
foreach ($values as $key => $value) {
foreach ($data as $key => $value) {
if(isset($mapping[$key])){
if($value){
$otUser->where('orden_trabajo_id',$data['orden_trabajo_id'])
$otUser->where('orden_trabajo_id',$orden_trabajo_id)
->set([$mapping[$key] => $auth_user_id])
->update();
}

View File

@ -9,7 +9,7 @@ use CodeIgniter\Model;
class TarifaExtraMaquinaModel extends Model
{
protected $table = 'tarifa_acabado_maquinas';
protected $table = 'tarifa_extra_maquinas';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = TarifaExtraMaquinaEntity::class;