更新
This commit is contained in:
@@ -176,7 +176,8 @@ class MyPatientController extends BaseAdminController
|
||||
(string) $params['action'],
|
||||
(string) ($params['remark'] ?? ''),
|
||||
$this->adminId,
|
||||
$this->adminInfo
|
||||
$this->adminInfo,
|
||||
$params['signature'] ?? ''
|
||||
);
|
||||
if ($result === false) {
|
||||
return $this->fail(PrescriptionOrderLogic::getError());
|
||||
|
||||
@@ -88,7 +88,8 @@ class PrescriptionController extends BaseAdminController
|
||||
public function detail()
|
||||
{
|
||||
$params = (new PrescriptionValidate())->get()->goCheck('detail');
|
||||
$detail = PrescriptionLogic::detail((int) $params['id'], (int) $this->adminId, $this->adminInfo);
|
||||
$detail = PrescriptionLogic::detail((int) $params['id'], (int) $this->adminId, $this->adminInfo,
|
||||
(int) ($params['prescription_order_id'] ?? 0));
|
||||
|
||||
if (!$detail) {
|
||||
$msg = PrescriptionLogic::getError();
|
||||
|
||||
@@ -256,7 +256,8 @@ class PrescriptionOrderController extends BaseAdminController
|
||||
(string) $params['action'],
|
||||
(string) ($params['remark'] ?? ''),
|
||||
$this->adminId,
|
||||
$this->adminInfo
|
||||
$this->adminInfo,
|
||||
$params['signature'] ?? ''
|
||||
);
|
||||
if ($result === false) {
|
||||
return $this->fail(PrescriptionOrderLogic::getError());
|
||||
|
||||
@@ -52,6 +52,7 @@ class OperationLog
|
||||
}
|
||||
|
||||
$params = $request->param();
|
||||
$this->stripLargeLogFields($params);
|
||||
|
||||
//过滤密码参数
|
||||
if (isset($params['password'])) {
|
||||
@@ -100,6 +101,10 @@ class OperationLog
|
||||
private function stripLargeLogFields(array &$data): void
|
||||
{
|
||||
foreach ($data as $key => &$value) {
|
||||
if (is_string($key) && in_array($key, ['signature', 'prescription_audit_signature', 'audit_signature'], true)) {
|
||||
$value = '[omitted]';
|
||||
continue;
|
||||
}
|
||||
if (is_array($value)) {
|
||||
$this->stripLargeLogFields($value);
|
||||
continue;
|
||||
@@ -112,4 +117,4 @@ class OperationLog
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -609,6 +609,7 @@ class PrescriptionOrderLists extends BaseAdminDataLists implements ListsSearchIn
|
||||
{
|
||||
$query = $this->buildFilteredQuery();
|
||||
$lists = $query
|
||||
->withoutField('prescription_audit_signature')
|
||||
->order('id', 'desc')
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->select()
|
||||
|
||||
@@ -779,7 +779,7 @@ class PrescriptionLogic
|
||||
/**
|
||||
* 处方详情(带查看权限校验,供后台管理端)
|
||||
*/
|
||||
public static function detail(int $id, int $viewerAdminId, array $viewerAdminInfo): ?array
|
||||
public static function detail(int $id, int $viewerAdminId, array $viewerAdminInfo, int $prescriptionOrderId = 0): ?array
|
||||
{
|
||||
self::$error = '';
|
||||
$row = Prescription::find($id);
|
||||
@@ -819,11 +819,18 @@ class PrescriptionLogic
|
||||
* - order_no 用于处方笺右上角「编号」
|
||||
* - amount 作为「合计」金额回填(前端再做 0 兜底展示)
|
||||
*/
|
||||
$latestPo = PrescriptionOrder::where('prescription_id', $id)
|
||||
->whereNull('delete_time')
|
||||
->where('fulfillment_status', '<>', 4)
|
||||
->order('id', 'desc')
|
||||
->find();
|
||||
$orderQuery = PrescriptionOrder::where('prescription_id', $id)->whereNull('delete_time');
|
||||
if ($prescriptionOrderId > 0) {
|
||||
$latestPo = $orderQuery->where('id', $prescriptionOrderId)->find();
|
||||
if (!$latestPo || !PrescriptionOrderLogic::canAccessOrder($latestPo, $viewerAdminId, $viewerAdminInfo)) {
|
||||
self::setError('业务订单不存在、与处方不匹配或无权限查看');
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
$latestPo = $orderQuery
|
||||
->whereNotIn('fulfillment_status', PrescriptionOrder::RELEASED_PRESCRIPTION_STATUSES)
|
||||
->order('id', 'desc')->find();
|
||||
}
|
||||
if ($latestPo) {
|
||||
$arr['recipient_name'] = (string) ($latestPo->recipient_name ?? '');
|
||||
$arr['recipient_phone'] = (string) ($latestPo->recipient_phone ?? '');
|
||||
@@ -832,6 +839,23 @@ class PrescriptionLogic
|
||||
$arr['order_amount'] = round((float) ($latestPo->amount ?? 0), 2);
|
||||
}
|
||||
|
||||
// A prescription's independent audit_status is not the business order's pharmacist review.
|
||||
$arr['prescription_order_id'] = $latestPo ? (int) $latestPo->id : null;
|
||||
$arr['prescription_audit_status'] = $latestPo ? (int) $latestPo->prescription_audit_status : 0;
|
||||
$arr['prescription_audit_signature'] = '';
|
||||
$arr['prescription_audit_signed_by'] = null;
|
||||
$arr['prescription_audit_signed_name'] = '';
|
||||
$arr['prescription_audit_signed_at'] = null;
|
||||
if ($latestPo && (int) $latestPo->prescription_audit_status === 1
|
||||
&& !in_array((int) $latestPo->fulfillment_status, PrescriptionOrder::RELEASED_PRESCRIPTION_STATUSES, true)
|
||||
&& trim((string) ($latestPo->prescription_audit_signature ?? '')) !== ''
|
||||
&& PrescriptionOrderLogic::canAccessOrder($latestPo, $viewerAdminId, $viewerAdminInfo)) {
|
||||
foreach (['prescription_audit_signature', 'prescription_audit_signed_by',
|
||||
'prescription_audit_signed_name', 'prescription_audit_signed_at'] as $field) {
|
||||
$arr[$field] = $latestPo->$field;
|
||||
}
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ use app\common\service\pharmacy\PharmacySubmissionClaimService;
|
||||
use app\common\service\pharmacy\PharmacySubmissionClaimWorkflow;
|
||||
use app\common\service\pharmacy\PharmacySupplyMode;
|
||||
use app\common\service\tcm\RevisitDueHook;
|
||||
use app\common\service\tcm\PrescriptionAuditSignature;
|
||||
use think\db\Query;
|
||||
use think\facade\Config;
|
||||
use think\facade\Db;
|
||||
@@ -48,6 +49,8 @@ class PrescriptionOrderLogic
|
||||
|
||||
private const TRACKING_AUDIT_REQUIRED = '处方审核和支付单审核均通过后,才可填写或修改快递单号';
|
||||
|
||||
private const SIGNATURE_STORAGE_ERROR = '审核签名未完整保存,审核已撤销。请执行签名数据库迁移 2026_11_13_prescription_order_audit_signature.sql 并刷新后端字段缓存后重试';
|
||||
|
||||
public static function setError(string $msg): void
|
||||
{
|
||||
self::$error = $msg;
|
||||
@@ -58,6 +61,73 @@ class PrescriptionOrderLogic
|
||||
return self::$error;
|
||||
}
|
||||
|
||||
/** The order row serializes audit submissions and manual audit corrections. */
|
||||
private static function mutateAuditState(int $id, callable $mutation)
|
||||
{
|
||||
self::$error = '';
|
||||
try {
|
||||
return Db::transaction(static function () use ($id, $mutation) {
|
||||
$order = PrescriptionOrder::where('id', $id)->whereNull('delete_time')->lock(true)->find();
|
||||
if (!$order) {
|
||||
throw new \DomainException('订单不存在');
|
||||
}
|
||||
$result = $mutation();
|
||||
if ($result === false) {
|
||||
throw new \DomainException(self::$error ?: '审核变更未保存');
|
||||
}
|
||||
return $result;
|
||||
});
|
||||
} catch (\Throwable $exception) {
|
||||
self::$error = self::$error ?: $exception->getMessage();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static function clearPrescriptionAuditSignature(PrescriptionOrder $order): void
|
||||
{
|
||||
$order->prescription_audit_signature = null;
|
||||
$order->prescription_audit_signed_by = null;
|
||||
$order->prescription_audit_signed_name = '';
|
||||
$order->prescription_audit_signed_at = null;
|
||||
}
|
||||
|
||||
private static function signPrescriptionAudit(PrescriptionOrder $order, string $signature, int $adminId, array $adminInfo): void
|
||||
{
|
||||
if ($adminId <= 0) {
|
||||
throw new \DomainException('审核人身份无效');
|
||||
}
|
||||
$name = trim((string) ($adminInfo['name'] ?? ''));
|
||||
if ($name === '') {
|
||||
$name = trim((string) Admin::where('id', $adminId)->value('name'));
|
||||
}
|
||||
if ($name === '') {
|
||||
throw new \DomainException('请完善审核人姓名后签名');
|
||||
}
|
||||
$order->prescription_audit_signature = $signature;
|
||||
$order->prescription_audit_signed_by = $adminId;
|
||||
$order->prescription_audit_signed_name = mb_substr($name, 0, 64);
|
||||
$order->prescription_audit_signed_at = time();
|
||||
}
|
||||
|
||||
/** Model::save filters unknown fields silently; verify the actual master row before commit. */
|
||||
private static function assertPrescriptionAuditSignatureStored(PrescriptionOrder $order): void
|
||||
{
|
||||
try {
|
||||
$stored = Db::name('tcm_prescription_order')->master()->where('id', (int) $order->id)
|
||||
->field(['prescription_audit_signature', 'prescription_audit_signed_by',
|
||||
'prescription_audit_signed_name', 'prescription_audit_signed_at'])->find();
|
||||
if (!$stored
|
||||
|| (string) ($stored['prescription_audit_signature'] ?? '') !== (string) $order->prescription_audit_signature
|
||||
|| (int) ($stored['prescription_audit_signed_by'] ?? 0) !== (int) $order->prescription_audit_signed_by
|
||||
|| (string) ($stored['prescription_audit_signed_name'] ?? '') !== (string) $order->prescription_audit_signed_name
|
||||
|| (int) ($stored['prescription_audit_signed_at'] ?? 0) !== (int) $order->prescription_audit_signed_at) {
|
||||
throw new \RuntimeException('Persisted review does not match the signing event');
|
||||
}
|
||||
} catch (\Throwable $exception) {
|
||||
throw new \RuntimeException(self::SIGNATURE_STORAGE_ERROR, 0, $exception);
|
||||
}
|
||||
}
|
||||
|
||||
private static function assertTrackingAuditApproved(PrescriptionOrder $order): bool
|
||||
{
|
||||
if ((int) $order->prescription_audit_status !== 1 || (int) $order->payment_slip_audit_status !== 1) {
|
||||
@@ -737,6 +807,7 @@ class PrescriptionOrderLogic
|
||||
foreach ($rows as $order) {
|
||||
$order->prescription_audit_status = 0;
|
||||
$order->prescription_audit_remark = '';
|
||||
self::clearPrescriptionAuditSignature($order);
|
||||
$order->payment_slip_audit_status = 0;
|
||||
$order->payment_slip_audit_remark = '';
|
||||
self::syncFulfillmentStatus($order);
|
||||
@@ -1253,7 +1324,7 @@ class PrescriptionOrderLogic
|
||||
$arr['prescription_detail_error'] = '';
|
||||
$arr['doctor_name'] = '';
|
||||
if ($rxId > 0) {
|
||||
$rxDetail = PrescriptionLogic::detail($rxId, $adminId, $adminInfo);
|
||||
$rxDetail = PrescriptionLogic::detail($rxId, $adminId, $adminInfo, $id);
|
||||
if ($rxDetail !== null) {
|
||||
$arr['prescription'] = $rxDetail;
|
||||
// 添加开方人姓名(优先使用处方的 doctor_name,否则从 creator_id 获取)
|
||||
@@ -2311,6 +2382,7 @@ class PrescriptionOrderLogic
|
||||
}
|
||||
|
||||
$order->fulfillment_status = 4;
|
||||
self::clearPrescriptionAuditSignature($order);
|
||||
self::clearPayOrderLinks($order);
|
||||
|
||||
try {
|
||||
@@ -2349,7 +2421,28 @@ class PrescriptionOrderLogic
|
||||
/**
|
||||
* @return array<string,mixed>|false
|
||||
*/
|
||||
public static function auditPrescription(int $id, string $action, string $remark, int $adminId, array $adminInfo)
|
||||
public static function auditPrescription(int $id, string $action, string $remark, int $adminId, array $adminInfo, mixed $signature = '')
|
||||
{
|
||||
self::$error = '';
|
||||
try {
|
||||
$signature = PrescriptionAuditSignature::normalize($signature);
|
||||
} catch (\DomainException $exception) {
|
||||
self::$error = $exception->getMessage();
|
||||
return false;
|
||||
}
|
||||
$result = self::mutateAuditState($id, static fn () => self::auditPrescriptionLocked(
|
||||
$id, $action, $remark, $adminId, $adminInfo, $signature
|
||||
));
|
||||
if ($result !== false && $action === 'approve') {
|
||||
$syncRemark = trim($remark) !== '' ? trim($remark) : '业务订单处方审核通过';
|
||||
PrescriptionLogic::syncApproveConsumerPrescriptionIfPending(
|
||||
(int) $result['prescription_id'], $adminId, $adminInfo, $syncRemark
|
||||
);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
private static function auditPrescriptionLocked(int $id, string $action, string $remark, int $adminId, array $adminInfo, string $signature)
|
||||
{
|
||||
self::$error = '';
|
||||
$order = PrescriptionOrder::where('id', $id)->whereNull('delete_time')->find();
|
||||
@@ -2363,6 +2456,10 @@ class PrescriptionOrderLogic
|
||||
|
||||
return false;
|
||||
}
|
||||
if (!in_array($action, ['approve', 'reject'], true)) {
|
||||
self::$error = '审核操作无效';
|
||||
return false;
|
||||
}
|
||||
if ((int) $order->prescription_audit_status !== 0) {
|
||||
self::$error = '当前无需处方审核';
|
||||
|
||||
@@ -2381,6 +2478,7 @@ class PrescriptionOrderLogic
|
||||
return false;
|
||||
}
|
||||
|
||||
self::signPrescriptionAudit($order, $signature, $adminId, $adminInfo);
|
||||
if ($action === 'approve') {
|
||||
$order->prescription_audit_status = 1;
|
||||
$order->prescription_audit_remark = mb_substr(trim($remark), 0, 500);
|
||||
@@ -2397,25 +2495,18 @@ class PrescriptionOrderLogic
|
||||
|
||||
try {
|
||||
$order->save();
|
||||
self::assertPrescriptionAuditSignatureStored($order);
|
||||
} catch (\Throwable $e) {
|
||||
self::$error = $e->getMessage();
|
||||
self::$error = self::SIGNATURE_STORAGE_ERROR;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($action === 'approve') {
|
||||
$syncRemark = trim($remark) !== '' ? trim($remark) : '业务订单处方审核通过';
|
||||
PrescriptionLogic::syncApproveConsumerPrescriptionIfPending(
|
||||
(int) $order->prescription_id,
|
||||
$adminId,
|
||||
$adminInfo,
|
||||
$syncRemark
|
||||
);
|
||||
}
|
||||
|
||||
$actionName = $action === 'approve' ? 'audit_rx_approve' : 'audit_rx_reject';
|
||||
$summary = $action === 'approve' ? '处方审核通过' . ($remark ? ',意见:' . $remark : '') : '处方审核驳回,意见:' . $remark;
|
||||
self::writeLog((int) $order->id, $adminId, $adminInfo, $actionName, $summary);
|
||||
self::writeLog((int) $order->id, $adminId,
|
||||
array_replace($adminInfo, ['name' => $order->prescription_audit_signed_name]),
|
||||
$actionName, $summary, true, $signature, (int) $order->prescription_audit_signed_at);
|
||||
|
||||
$out = $order->toArray();
|
||||
self::maskInternalCostIfNeeded($out, $adminInfo);
|
||||
@@ -2620,6 +2711,7 @@ class PrescriptionOrderLogic
|
||||
|
||||
$order->prescription_audit_status = 0;
|
||||
$order->prescription_audit_remark = '';
|
||||
self::clearPrescriptionAuditSignature($order);
|
||||
// 如果支付审核不是待审核,也一并重置
|
||||
if ((int) $order->payment_slip_audit_status !== 0) {
|
||||
$order->payment_slip_audit_status = 0;
|
||||
@@ -2657,7 +2749,7 @@ class PrescriptionOrderLogic
|
||||
}
|
||||
}
|
||||
|
||||
self::writeLog((int) $order->id, $adminId, $adminInfo, 'revoke_rx_audit', '撤回处方审核,状态重置为待审核');
|
||||
self::writeLog((int) $order->id, $adminId, $adminInfo, 'revoke_rx_audit', '撤回处方审核,状态重置为待审核', true);
|
||||
|
||||
$out = $order->toArray();
|
||||
self::maskInternalCostIfNeeded($out, $adminInfo);
|
||||
@@ -2774,6 +2866,12 @@ class PrescriptionOrderLogic
|
||||
* @return array<string,mixed>|false
|
||||
*/
|
||||
public static function addLog(array $params, int $adminId, array $adminInfo)
|
||||
{
|
||||
return self::mutateAuditState((int) ($params['id'] ?? 0),
|
||||
static fn () => self::addLogLocked($params, $adminId, $adminInfo));
|
||||
}
|
||||
|
||||
private static function addLogLocked(array $params, int $adminId, array $adminInfo)
|
||||
{
|
||||
self::$error = '';
|
||||
$id = (int) ($params['id'] ?? 0);
|
||||
@@ -2797,6 +2895,8 @@ class PrescriptionOrderLogic
|
||||
}
|
||||
|
||||
$changeParts = [];
|
||||
$auditSignature = '';
|
||||
$signedAt = null;
|
||||
$hasRxChange = array_key_exists('prescription_audit_status', $params)
|
||||
&& $params['prescription_audit_status'] !== ''
|
||||
&& $params['prescription_audit_status'] !== null;
|
||||
@@ -2816,6 +2916,14 @@ class PrescriptionOrderLogic
|
||||
|
||||
return false;
|
||||
}
|
||||
if ($newRx === 0) {
|
||||
self::clearPrescriptionAuditSignature($order);
|
||||
} else {
|
||||
$auditSignature = PrescriptionAuditSignature::normalize($params['signature'] ?? '');
|
||||
self::signPrescriptionAudit($order, $auditSignature, $adminId, $adminInfo);
|
||||
$signedAt = (int) $order->prescription_audit_signed_at;
|
||||
$adminInfo = array_replace($adminInfo, ['name' => $order->prescription_audit_signed_name]);
|
||||
}
|
||||
$oldRx = (int) $order->prescription_audit_status;
|
||||
if ($newRx !== $oldRx) {
|
||||
$order->prescription_audit_status = $newRx;
|
||||
@@ -2854,8 +2962,11 @@ class PrescriptionOrderLogic
|
||||
self::syncFulfillmentStatus($order);
|
||||
try {
|
||||
$order->save();
|
||||
if ($auditSignature !== '') {
|
||||
self::assertPrescriptionAuditSignatureStored($order);
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
self::$error = $e->getMessage();
|
||||
self::$error = $auditSignature !== '' ? self::SIGNATURE_STORAGE_ERROR : $e->getMessage();
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -2865,7 +2976,7 @@ class PrescriptionOrderLogic
|
||||
if ($changeParts !== []) {
|
||||
$logSummary .= '(' . implode(';', $changeParts) . ')';
|
||||
}
|
||||
self::writeLog($id, $adminId, $adminInfo, 'manual_log', $logSummary);
|
||||
self::writeLog($id, $adminId, $adminInfo, 'manual_log', $logSummary, true, $auditSignature, $signedAt);
|
||||
|
||||
$out = $order->toArray();
|
||||
self::maskInternalCostIfNeeded($out, $adminInfo);
|
||||
@@ -5731,7 +5842,9 @@ class PrescriptionOrderLogic
|
||||
array $adminInfo,
|
||||
string $action,
|
||||
string $summary,
|
||||
bool $strict = false
|
||||
bool $strict = false,
|
||||
string $auditSignature = '',
|
||||
?int $signedAt = null
|
||||
): void
|
||||
{
|
||||
$adminName = $adminInfo['name'] ?? '';
|
||||
@@ -5745,13 +5858,27 @@ class PrescriptionOrderLogic
|
||||
$log->admin_name = mb_substr($adminName, 0, 64);
|
||||
$log->action = mb_substr($action, 0, 32);
|
||||
$log->summary = mb_substr($summary, 0, 500);
|
||||
$log->create_time = time();
|
||||
$log->create_time = $signedAt ?? time();
|
||||
if ($auditSignature !== '') {
|
||||
$log->audit_signature = $auditSignature;
|
||||
}
|
||||
|
||||
try {
|
||||
$log->save();
|
||||
if ($auditSignature !== '') {
|
||||
$stored = Db::name('tcm_prescription_order_log')->master()->where('id', (int) $log->id)
|
||||
->field(['prescription_order_id', 'admin_id', 'admin_name', 'create_time', 'audit_signature'])->find();
|
||||
if (!$stored || (int) $stored['prescription_order_id'] !== $orderId
|
||||
|| (int) $stored['admin_id'] !== $adminId
|
||||
|| (string) $stored['admin_name'] !== (string) $log->admin_name
|
||||
|| (int) $stored['create_time'] !== (int) $log->create_time
|
||||
|| (string) ($stored['audit_signature'] ?? '') !== $auditSignature) {
|
||||
throw new \RuntimeException(self::SIGNATURE_STORAGE_ERROR);
|
||||
}
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
if ($strict) {
|
||||
throw new \RuntimeException('操作日志写入失败,变更未保存', 0, $e);
|
||||
if ($strict || $auditSignature !== '') {
|
||||
throw new \RuntimeException($auditSignature !== '' ? self::SIGNATURE_STORAGE_ERROR : '操作日志写入失败,变更未保存', 0, $e);
|
||||
}
|
||||
// 非关键日志沿用历史容错行为
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ class PrescriptionOrderValidate extends BaseValidate
|
||||
'remark_extra' => 'max:500',
|
||||
'remark_assistant' => 'max:500',
|
||||
'action' => 'require|in:approve,reject',
|
||||
'signature' => 'require|string|max:349550',
|
||||
'remark' => 'max:500',
|
||||
'summary' => 'require|max:500',
|
||||
'prescription_audit_status' => 'in:0,1,2',
|
||||
@@ -58,6 +59,9 @@ class PrescriptionOrderValidate extends BaseValidate
|
||||
'fee_type.require' => '请选择费用类别',
|
||||
'amount.require' => '请输入订单金额',
|
||||
'action.require' => '请选择审核操作',
|
||||
'signature.require' => '请先完成审核签名',
|
||||
'signature.string' => '审核签名格式无效',
|
||||
'signature.max' => '审核签名图片过大,请清空后重新签名',
|
||||
'patient_name.require' => '请输入患者姓名',
|
||||
'phone.require' => '请输入手机号',
|
||||
'tracking_number.require' => '请输入快递单号',
|
||||
@@ -83,7 +87,7 @@ class PrescriptionOrderValidate extends BaseValidate
|
||||
'ddcode' => ['id', 'tracking_number', 'express_company'],
|
||||
'logisticsTrace' => ['id', 'phone_tail'],
|
||||
'logisticsJdUpdate' => ['id'],
|
||||
'auditPrescription' => ['id', 'action', 'remark'],
|
||||
'auditPrescription' => ['id', 'action', 'remark', 'signature'],
|
||||
'auditPayment' => ['id', 'action', 'remark'],
|
||||
'withdraw' => ['id'],
|
||||
'ship' => ['id', 'tracking_number', 'express_company', 'ship_mode'],
|
||||
@@ -113,6 +117,14 @@ class PrescriptionOrderValidate extends BaseValidate
|
||||
->append('pay_order_id', 'require|integer|gt:0');
|
||||
}
|
||||
|
||||
public function sceneAddLog(): PrescriptionOrderValidate
|
||||
{
|
||||
return $this->only([
|
||||
'id', 'summary', 'prescription_audit_status', 'payment_slip_audit_status',
|
||||
'prescription_audit_remark', 'payment_slip_audit_remark', 'signature',
|
||||
])->remove('signature', 'require');
|
||||
}
|
||||
|
||||
public function sceneEditTime(): PrescriptionOrderValidate
|
||||
{
|
||||
return $this->only(['id', 'create_time'])->append('id', 'require|integer|gt:0');
|
||||
|
||||
@@ -9,6 +9,7 @@ use app\common\validate\BaseValidate;
|
||||
class PrescriptionValidate extends BaseValidate
|
||||
{
|
||||
protected $rule = [
|
||||
'prescription_order_id' => 'integer|gt:0',
|
||||
'id' => 'require',
|
||||
'diagnosis_id' => 'number',
|
||||
'appointment_id' => 'number',
|
||||
@@ -71,7 +72,7 @@ class PrescriptionValidate extends BaseValidate
|
||||
|
||||
public function sceneDetail()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
return $this->only(['id', 'prescription_order_id']);
|
||||
}
|
||||
|
||||
public function scenePatchPatient()
|
||||
|
||||
Reference in New Issue
Block a user