update condef color
This commit is contained in:
parent
20350db5bd
commit
11dca70c70
@ -33,7 +33,7 @@ class ContainerDef extends BaseController {
|
|||||||
|
|
||||||
public function show($ConDefID) {
|
public function show($ConDefID) {
|
||||||
try {
|
try {
|
||||||
$rows = $this->model->find($ConDefID);
|
$rows = $this->model->getContainer($ConDefID);
|
||||||
return $this->respond([ 'status' => 'success', 'message'=> "data fetched successfully", 'data' => $rows ], 200);
|
return $this->respond([ 'status' => 'success', 'message'=> "data fetched successfully", 'data' => $rows ], 200);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return $this->failServerError('Exception : '.$e->getMessage());
|
return $this->failServerError('Exception : '.$e->getMessage());
|
||||||
|
|||||||
@ -14,8 +14,8 @@ class CreateSpecimenTable extends Migration {
|
|||||||
'ConName' => ['type' => 'varchar', 'constraint' => 50, 'null' => true],
|
'ConName' => ['type' => 'varchar', 'constraint' => 50, 'null' => true],
|
||||||
'ConDesc' => ['type' => 'varchar', 'constraint' => 50, 'null' => true],
|
'ConDesc' => ['type' => 'varchar', 'constraint' => 50, 'null' => true],
|
||||||
'Additive' => ['type' => 'varchar', 'constraint' => 50, 'null' => true],
|
'Additive' => ['type' => 'varchar', 'constraint' => 50, 'null' => true],
|
||||||
'ConClass' => ['type' => 'int', 'null' => false],
|
'ConClass' => ['type' => 'int', 'null' => true],
|
||||||
'Color' => ['type' => 'int', 'null' => false],
|
'Color' => ['type' => 'int', 'null' => true],
|
||||||
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
'CreateDate' => ['type' => 'Datetime', 'null' => true],
|
||||||
'EndDate' => ['type' => 'DATETIME', 'null' => true]
|
'EndDate' => ['type' => 'DATETIME', 'null' => true]
|
||||||
]);
|
]);
|
||||||
|
|||||||
@ -20,4 +20,10 @@ class ContainerDefModel extends BaseModel {
|
|||||||
protected $afterInsert = ['convertDatesToUTCISO'];
|
protected $afterInsert = ['convertDatesToUTCISO'];
|
||||||
protected $afterUpdate = ['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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user