32 lines
723 B
PHP
32 lines
723 B
PHP
|
|
<?php
|
||
|
|
namespace App\Models\Qc;
|
||
|
|
|
||
|
|
use App\Models\BaseModel;
|
||
|
|
|
||
|
|
class ResultsModel extends BaseModel {
|
||
|
|
protected $table = 'results';
|
||
|
|
protected $primaryKey = 'result_id';
|
||
|
|
protected $allowedFields = [
|
||
|
|
'control_id',
|
||
|
|
'test_id',
|
||
|
|
'res_date',
|
||
|
|
'res_value',
|
||
|
|
'res_comment',
|
||
|
|
'created_at',
|
||
|
|
'updated_at',
|
||
|
|
'deleted_at'
|
||
|
|
];
|
||
|
|
protected $useTimestamps = true;
|
||
|
|
protected $useSoftDeletes = true;
|
||
|
|
|
||
|
|
public function search($keyword = null) {
|
||
|
|
if ($keyword) {
|
||
|
|
return $this->groupStart()
|
||
|
|
->like('res_value', $keyword)
|
||
|
|
->groupEnd()
|
||
|
|
->findAll();
|
||
|
|
}
|
||
|
|
return $this->findAll();
|
||
|
|
}
|
||
|
|
}
|