feat: 图片支持多张上传
This commit is contained in:
parent
a79064eedc
commit
f6dfba93f7
|
|
@ -217,15 +217,15 @@ class OrderDispatchService extends BaseService
|
|||
* 完成上门
|
||||
* @param int $workerId 师傅id
|
||||
* @param int $orderDispatchId 派单id
|
||||
* @param string $img 上门图片
|
||||
* @param string $images 上门图片
|
||||
* @return true
|
||||
*/
|
||||
public function arrivedOnSite(int $workerId, int $orderDispatchId, string $img)
|
||||
public function arrivedOnSite(int $workerId, int $orderDispatchId, string $images)
|
||||
{
|
||||
$time = datetime(time());
|
||||
$orderDispatch = $this->getOrderDispatchInfo($workerId, $orderDispatchId);
|
||||
$orderDispatch->status = OrderDispatch::STATUS_CLOCK;
|
||||
$orderDispatch->arrive_image = $img;
|
||||
$orderDispatch->arrive_images = $this->removeStrCdnUrl($images);
|
||||
$orderDispatch->arrive_time = $time;
|
||||
$orderDispatch->save();
|
||||
|
||||
|
|
@ -239,6 +239,17 @@ class OrderDispatchService extends BaseService
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 移出字符串中的 cdnUrl
|
||||
* @param string $str
|
||||
* @return string
|
||||
*/
|
||||
private function removeStrCdnUrl(string $str): string
|
||||
{
|
||||
$cdnUrl = cdnurl('', true);
|
||||
return str_replace($cdnUrl, '', $str);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单信息
|
||||
* @param int $workerId 师傅id
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class OrderDispatch extends WorkerApi
|
|||
$this->error($validate);
|
||||
}
|
||||
|
||||
$res = $this->getOrderDispatchService()->arrivedOnSite($this->user['id'], $params['order_dispatch_id'], $params['img']);
|
||||
$res = $this->getOrderDispatchService()->arrivedOnSite($this->user['id'], $params['order_dispatch_id'], $params['images']);
|
||||
$this->success('操作成功', $res);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class OrderDispatch extends Validate
|
|||
'order_dispatch_id|订单派单id' => 'require|number',
|
||||
'workbench_type|工作台类型' => 'require|in:ongoing,today,tomorrow,all',
|
||||
'plan_time|预约时间' => 'require|date',
|
||||
'img|上门图片' => 'require|max:300',
|
||||
'images|上门图片' => 'require|max:3000',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
|
|
@ -23,6 +23,6 @@ class OrderDispatch extends Validate
|
|||
'workbenchOrderList' => ['workbench_type'],
|
||||
'info' => ['order_dispatch_id'],
|
||||
'appointmentTime' => ['order_dispatch_id', 'plan_time'],
|
||||
'arrivedOnSite' => ['order_dispatch_id', 'img'],
|
||||
'arrivedOnSite' => ['order_dispatch_id', 'images'],
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user