mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
add colors plannings
This commit is contained in:
@ -87,12 +87,12 @@ class OrdenTrabajoEntity extends Entity
|
||||
public function dates(): ?OrdenTrabajoDateEntity
|
||||
{
|
||||
$m = model(OrdenTrabajoDate::class);
|
||||
return $m->where('orden_trabajo_id',$this->attributes["id"])->first();
|
||||
return $m->where('orden_trabajo_id', $this->attributes["id"])->first();
|
||||
}
|
||||
public function users(): ?OrdenTrabajoUserEntity
|
||||
{
|
||||
$m = model(OrdenTrabajoUser::class);
|
||||
return $m->where('orden_trabajo_id',$this->attributes["id"])->first();
|
||||
return $m->where('orden_trabajo_id', $this->attributes["id"])->first();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -109,24 +109,24 @@ class OrdenTrabajoEntity extends Entity
|
||||
$this->attributes["dates"] = $ot_dates->fill($data);
|
||||
return $this;
|
||||
}
|
||||
public function getBarCode() : string
|
||||
public function getBarCode(): string
|
||||
{
|
||||
$barcode = new TypeCode128();
|
||||
$renderer = new PngRenderer();
|
||||
$barcodeData = $barcode->getBarcode($this->pedido()->presupuesto()->id);
|
||||
return base64_encode($renderer->render($barcodeData,200, 50));
|
||||
return base64_encode($renderer->render($barcodeData, 200, 50));
|
||||
}
|
||||
public function files() : array
|
||||
public function files(): array
|
||||
{
|
||||
$m = model(OrdenTrabajoFileModel::class);
|
||||
return $m->where('orden_trabajo_id',$this->attributes['id'])->findAll() ?? [];
|
||||
return $m->where('orden_trabajo_id', $this->attributes['id'])->findAll() ?? [];
|
||||
}
|
||||
public function pedidoEsperaBy() : ?UserEntity
|
||||
public function pedidoEsperaBy(): ?UserEntity
|
||||
{
|
||||
$m = model(UserModel::class);
|
||||
if($this->attributes['pedido_espera_by']){
|
||||
if ($this->attributes['pedido_espera_by']) {
|
||||
return $m->findById($this->attributes['pedido_espera_by']);
|
||||
}else{
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -139,10 +139,10 @@ class OrdenTrabajoEntity extends Entity
|
||||
helper('filesystem');
|
||||
$path = WRITEPATH . 'uploads/' . $this->attributes["portada_path"];
|
||||
$portada_path = null;
|
||||
if($path){
|
||||
if(file_exists($path)){
|
||||
if ($path) {
|
||||
if (file_exists($path)) {
|
||||
$portada_path = $path;
|
||||
}else{
|
||||
} else {
|
||||
$portada_path = null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user