clqms-be/app/Models/Specimen/ContainerDefModel.php

29 lines
1.0 KiB
PHP

<?php
namespace App\Models\Specimen;
use App\Models\BaseModel;
class ContainerDefModel extends BaseModel {
protected $table = 'containerdef';
protected $primaryKey = 'ConDefID';
protected $allowedFields = ['SiteID', 'ConCode', 'ConName', 'ConDesc', 'Additive', 'ConClass', 'Color', 'CreateDate', 'EndDate'];
protected $useTimestamps = true;
protected $createdField = 'CreateDate';
protected $updatedField = '';
protected $useSoftDeletes = true;
protected $deletedField = 'EndDate';
protected $beforeInsert = ['normalizeDatesToUTC'];
protected $beforeUpdate = ['normalizeDatesToUTC'];
protected $afterFind = ['convertDatesToUTCISO'];
protected $afterInsert = ['convertDatesToUTCISO'];
protected $afterUpdate = ['convertDatesToUTCISO'];
public function getContainer($ConDefID) {
$rows = $this->select('containerdef.*, valueset.VValue as ColorTxt')
->join('valueset', 'valueset.VID=containerdef.Color', 'left')
->where('ConDefID', $ConDefID)->get()->getResultArray();
return $rows;
}
}