改进 错误处理
This commit is contained in:
parent
8f85d28a10
commit
e6fc281ec1
@ -76,6 +76,10 @@ protected static function boot()
|
||||
// load work order
|
||||
$model->load(['workOrder']);
|
||||
|
||||
// throw if work order is null
|
||||
if (is_null($model->workOrder)) {
|
||||
throw new CommonException('Work order not found');
|
||||
}
|
||||
throw_if($model->workOrder->status == 'pending' || $model->workOrder->status == 'error', CommonException::class, '工单状态不正确');
|
||||
|
||||
// change work order status
|
||||
|
Loading…
Reference in New Issue
Block a user