更新
This commit is contained in:
@@ -283,4 +283,38 @@ class DiagnosisController extends BaseAdminController
|
||||
$result = DiagnosisLogic::generateMiniProgramQrcode($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 搜索患者(用于创建订单等场景)
|
||||
* @return \think\response\Json
|
||||
*/
|
||||
public function searchPatient()
|
||||
{
|
||||
$keyword = $this->request->get('keyword', '');
|
||||
$page_no = $this->request->get('page_no', 1);
|
||||
$page_size = $this->request->get('page_size', 10);
|
||||
|
||||
if (empty($keyword)) {
|
||||
return $this->success('', ['lists' => [], 'count' => 0]);
|
||||
}
|
||||
|
||||
$offset = ($page_no - 1) * $page_size;
|
||||
|
||||
$lists = \app\common\model\tcm\Diagnosis::where('patient_name|patient_phone|patient_id_card', 'like', '%' . $keyword . '%')
|
||||
->field(['id', 'patient_name', 'patient_phone', 'patient_id_card', 'gender', 'age'])
|
||||
->limit($offset, $page_size)
|
||||
->order('id desc')
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
$count = \app\common\model\tcm\Diagnosis::where('patient_name|patient_phone|patient_id_card', 'like', '%' . $keyword . '%')
|
||||
->count();
|
||||
|
||||
return $this->success('', [
|
||||
'lists' => $lists,
|
||||
'count' => $count,
|
||||
'page_no' => $page_no,
|
||||
'page_size' => $page_size
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user