feat: 【小程序】完成服务接口新增定金凭证,订单详情接口新增定金凭证。
This commit is contained in:
parent
0e37fbb783
commit
f0cd58efe0
|
|
@ -62,6 +62,20 @@ class Order extends Model
|
||||||
return $images;
|
return $images;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getOffImagesAttr($val)
|
||||||
|
{
|
||||||
|
if (empty($val)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
$images = explode(',', $val);
|
||||||
|
foreach ($images as $k => $v) {
|
||||||
|
$images[$k] = cdnurl($v, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $images;
|
||||||
|
}
|
||||||
|
|
||||||
public function getMaterialImagesAttr($val)
|
public function getMaterialImagesAttr($val)
|
||||||
{
|
{
|
||||||
if (empty($val)) {
|
if (empty($val)) {
|
||||||
|
|
|
||||||
|
|
@ -234,6 +234,7 @@ class OrderDispatchService extends BaseService
|
||||||
'is_material_used',
|
'is_material_used',
|
||||||
'material_cost',
|
'material_cost',
|
||||||
'material_images',
|
'material_images',
|
||||||
|
'off_images',
|
||||||
];
|
];
|
||||||
$orderDispatchFields = [
|
$orderDispatchFields = [
|
||||||
'id',
|
'id',
|
||||||
|
|
@ -396,8 +397,13 @@ class OrderDispatchService extends BaseService
|
||||||
$orderDispatch->follow = 2;
|
$orderDispatch->follow = 2;
|
||||||
$orderDispatch->finish_time = $time;
|
$orderDispatch->finish_time = $time;
|
||||||
|
|
||||||
// 材料相关
|
|
||||||
$order = $this->getOrderModel()->where('id', $orderDispatch->order_id)->find();
|
$order = $this->getOrderModel()->where('id', $orderDispatch->order_id)->find();
|
||||||
|
|
||||||
|
// 定金核销凭证
|
||||||
|
if (!empty($params['off_images'])) {
|
||||||
|
$order->off_images = $this->removeStrCdnUrl($params['off_images']);
|
||||||
|
}
|
||||||
|
|
||||||
// 是否使用材料
|
// 是否使用材料
|
||||||
$order->is_material_used = $params['is_material_used'];
|
$order->is_material_used = $params['is_material_used'];
|
||||||
if ($order->is_material_used == 1) {
|
if ($order->is_material_used == 1) {
|
||||||
|
|
@ -406,9 +412,10 @@ class OrderDispatchService extends BaseService
|
||||||
$order->material_cost = $params['material_cost'];
|
$order->material_cost = $params['material_cost'];
|
||||||
// 材料凭证图片组
|
// 材料凭证图片组
|
||||||
$order->material_images = $this->removeStrCdnUrl($params['material_images']);
|
$order->material_images = $this->removeStrCdnUrl($params['material_images']);
|
||||||
$order->save();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$order->save();
|
||||||
|
|
||||||
if ($params['receive_type'] == 1) {
|
if ($params['receive_type'] == 1) {
|
||||||
$orderDispatch->image = $this->removeStrCdnUrl($params['payment_image']);
|
$orderDispatch->image = $this->removeStrCdnUrl($params['payment_image']);
|
||||||
$orderDispatch->offline_total_type = $params['offline_total_type'];
|
$orderDispatch->offline_total_type = $params['offline_total_type'];
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,9 @@ class OrderDispatch extends Validate
|
||||||
'is_material_used|是否使用材料' => 'require|in:0,1',
|
'is_material_used|是否使用材料' => 'require|in:0,1',
|
||||||
'material_cost|材料成本' => 'requireIf:is_material_used,1|number|between:0,10000000',
|
'material_cost|材料成本' => 'requireIf:is_material_used,1|number|between:0,10000000',
|
||||||
'material_images|材料凭证' => 'requireIf:is_material_used,1|max:1000',
|
'material_images|材料凭证' => 'requireIf:is_material_used,1|max:1000',
|
||||||
|
|
||||||
|
// 定金核销凭证相关
|
||||||
|
'off_images|定金核销凭证' => 'max:500',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $message = [
|
protected $message = [
|
||||||
|
|
@ -44,7 +47,18 @@ class OrderDispatch extends Validate
|
||||||
'info' => ['order_dispatch_id'],
|
'info' => ['order_dispatch_id'],
|
||||||
'appointmentTime' => ['order_dispatch_id', 'plan_time'],
|
'appointmentTime' => ['order_dispatch_id', 'plan_time'],
|
||||||
'arrivedOnSite' => ['order_dispatch_id', 'images'],
|
'arrivedOnSite' => ['order_dispatch_id', 'images'],
|
||||||
'completeService' => ['order_dispatch_id', 'complete_images', 'offline_total_type', 'amount', 'payment_image', 'offline_total_type', 'is_material_used', 'material_cost', 'material_images'],
|
'completeService' => [
|
||||||
|
'order_dispatch_id',
|
||||||
|
'complete_images',
|
||||||
|
'offline_total_type',
|
||||||
|
'amount',
|
||||||
|
'payment_image',
|
||||||
|
'offline_total_type',
|
||||||
|
'is_material_used',
|
||||||
|
'material_cost',
|
||||||
|
'material_images',
|
||||||
|
'off_images',
|
||||||
|
],
|
||||||
'saveWorkerRemark' => ['order_dispatch_id', 'worker_remark'],
|
'saveWorkerRemark' => ['order_dispatch_id', 'worker_remark'],
|
||||||
'updateProgress' => ['order_dispatch_id', 'is_finish_today', 'estimated_finish_time', 'work_progress'],
|
'updateProgress' => ['order_dispatch_id', 'is_finish_today', 'estimated_finish_time', 'work_progress'],
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user