fix: 完善取消退款恢复与师傅端流程
这个提交包含在:
@@ -51,20 +51,30 @@ class Base extends Api
|
||||
}
|
||||
|
||||
/**
|
||||
* 要求是已通过审核的师傅
|
||||
* 要求拥有师傅档案,允许查看师傅端。
|
||||
*/
|
||||
protected function requireMaster()
|
||||
protected function requireMasterProfile()
|
||||
{
|
||||
$master = $this->masterInfo();
|
||||
if (!$master) {
|
||||
$this->error('请先完成师傅入驻', ['need_apply' => 1], 2001);
|
||||
}
|
||||
return $master;
|
||||
}
|
||||
|
||||
/** 要求师傅通过审核,供接单及敏感操作使用。 */
|
||||
protected function requireMaster()
|
||||
{
|
||||
$master = $this->requireMasterProfile();
|
||||
if ($master['verify_status'] === 'pending') {
|
||||
$this->error('师傅资质审核中,请耐心等待', ['verify_status' => 'pending'], 2002);
|
||||
}
|
||||
if ($master['verify_status'] === 'reject') {
|
||||
$this->error('资质未通过:' . $master['audit_msg'], ['verify_status' => 'reject'], 2003);
|
||||
}
|
||||
if ($master['verify_status'] !== 'pass') {
|
||||
$this->error('师傅资质尚未审核通过,无法接单');
|
||||
}
|
||||
return $master;
|
||||
}
|
||||
|
||||
@@ -145,7 +155,10 @@ class Base extends Api
|
||||
'status' => (int)$to,
|
||||
'updatetime' => time(),
|
||||
]);
|
||||
Db::name('order')->where('id', (int)$order['id'])->update($data);
|
||||
$updated = Db::name('order')->where('id', (int)$order['id'])->where('status', $from)->update($data);
|
||||
if (!$updated) {
|
||||
$this->error('订单状态已变更,请刷新后重试');
|
||||
}
|
||||
$this->addLog((int)$order['id'], (int)$to, $remark, $operatorType, $operatorId);
|
||||
return array_merge($order, $data);
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户