delete is_deleted field

This commit is contained in:
amazuecos
2025-04-11 06:56:55 +02:00
parent 9e591a099d
commit 1e339b5503
11 changed files with 84 additions and 45 deletions

View File

@ -36,7 +36,6 @@ class ClientePlantillaPreciosLineasModel extends \App\Models\BaseModel
"tiempo_max",
"precio_hora",
"margen",
"is_deleted",
"deleted_at",
"created_at",
"updated_at",
@ -45,11 +44,12 @@ class ClientePlantillaPreciosLineasModel extends \App\Models\BaseModel
protected $returnType = "App\Entities\Clientes\ClientePlantillaPreciosLineasEntity";
protected $useTimestamps = true;
protected $useSoftDeletes = false;
protected $useSoftDeletes = true;
protected $createdField = "created_at";
protected $updatedField = "updated_at";
protected $deletedField = 'deleted_at';
public static $labelField = "plantilla_id";
@ -121,7 +121,6 @@ class ClientePlantillaPreciosLineasModel extends \App\Models\BaseModel
$this->db
->table($this->table . " t1")
->where('t1.plantilla_id', $plantilla_id)
->set('is_deleted', 1)
->set('deleted_at', $date_value)
->update();
@ -152,7 +151,7 @@ class ClientePlantillaPreciosLineasModel extends \App\Models\BaseModel
$builder->join("users t2", "t1.user_updated_id = t2.id", "left");
$builder->where('t1.is_deleted', 0);
$builder->where('t1.deleted_at', 0);
$builder->where('t1.plantilla_id', $plantilla_id);
if (empty($search))
@ -181,7 +180,7 @@ class ClientePlantillaPreciosLineasModel extends \App\Models\BaseModel
$rows = $this->db
->table($this->table)
->select("id, tiempo_min, tiempo_max")
->where("is_deleted", 0)
->where("deleted_at", null)
->where("tipo", $data["tipo"])
->where("tipo_maquina", $data["tipo_maquina"])
->where("tipo_impresion", $data["tipo_impresion"])