更新
This commit is contained in:
@@ -71,6 +71,7 @@ class PrescriptionLogic
|
||||
'clinical_diagnosis' => $params['clinical_diagnosis'] ?? '',
|
||||
'herbs' => $herbs,
|
||||
'dose_count' => (int)($params['dose_count'] ?? 1),
|
||||
'dose_unit' => $params['dose_unit'] ?? '剂',
|
||||
'usage_instruction' => $params['usage_instruction'] ?? '水煎服一日二次',
|
||||
'amount' => (float)($params['amount'] ?? 0),
|
||||
'doctor_name' => $params['doctor_name'] ?? '',
|
||||
@@ -121,4 +122,25 @@ class PrescriptionLogic
|
||||
->find();
|
||||
return $row ? $row->toArray() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 作废处方
|
||||
*/
|
||||
public static function void(int $id, int $adminId, string $adminName): bool
|
||||
{
|
||||
$row = Prescription::find($id);
|
||||
if (!$row) {
|
||||
self::setError('处方不存在');
|
||||
return false;
|
||||
}
|
||||
if ((int)($row->void_status ?? 0) === 1) {
|
||||
self::setError('该处方已作废');
|
||||
return false;
|
||||
}
|
||||
$row->void_status = 1;
|
||||
$row->void_time = time();
|
||||
$row->void_by = $adminId;
|
||||
$row->void_by_name = $adminName;
|
||||
return $row->save();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user