47 lines
1.9 KiB
PHP
47 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace app\worker\validate;
|
|
|
|
use think\Validate;
|
|
|
|
class OrderDispatch extends Validate
|
|
{
|
|
protected $rule = [
|
|
'type|确认类型' => 'require|in:accept,reject',
|
|
'order_dispatch_id|订单派单id' => 'require|number',
|
|
'workbench_type|工作台类型' => 'require|in:pending,need_visit,ongoing,finished',
|
|
'need_visit_type|待上门类型' => 'require|in:today,tomorrow,all',
|
|
'plan_time|预约时间' => 'require|date',
|
|
'images|上门图片' => 'require|max:3000',
|
|
|
|
'complete_images|完成图片' => 'require|max:3000',
|
|
'final_payment_method|收款方式' => 'requireIf:receive_type,1|in:1,2',
|
|
'amount|收款金额' => 'requireIf:receive_type,1|number|between:0,10000000',
|
|
'payment_image|收款图片' => 'requireIf:receive_type,1|max:255',
|
|
'offline_total_type|尾款收款方' => 'in:0,1,2',
|
|
'receive_type' => 'require|in:1,2',
|
|
|
|
'reject_reason|拒接原因' => 'max:100',
|
|
'worker_remark|备注信息' => 'max:500',
|
|
|
|
'is_finish_today|今日完成' => 'require|in:0,1',
|
|
'estimated_finish_time|完成时间' => 'require|date',
|
|
'work_progress|当前施工进度' => 'max:200',
|
|
];
|
|
|
|
protected $message = [
|
|
|
|
];
|
|
|
|
protected $scene = [
|
|
'orderConfirm' => ['type', 'order_dispatch_id', 'reject_reason'],
|
|
'workbenchOrderList' => ['workbench_type', 'need_visit_type'],
|
|
'info' => ['order_dispatch_id'],
|
|
'appointmentTime' => ['order_dispatch_id', 'plan_time'],
|
|
'arrivedOnSite' => ['order_dispatch_id', 'images'],
|
|
'completeService' => ['order_dispatch_id', 'complete_images', 'offline_total_type', 'amount', 'payment_image', 'offline_total_type'],
|
|
'saveWorkerRemark' => ['order_dispatch_id', 'worker_remark'],
|
|
'updateProgress' => ['order_dispatch_id', 'is_finish_today', 'estimated_finish_time', 'work_progress'],
|
|
];
|
|
}
|