generated from liutk/owl-admin-base
admin workflow
parent
82930c1cf5
commit
fad798fc03
|
|
@ -143,8 +143,21 @@ class WorkflowController extends Controller
|
||||||
], [
|
], [
|
||||||
'remarks.required_if' => '未通过原因必填',
|
'remarks.required_if' => '未通过原因必填',
|
||||||
]);
|
]);
|
||||||
$check = WorkflowCheck::where('subject_type', $request->input('subject_type'))->where('subject_id', $id)->firstOrFail();
|
$subjectType = $request->input('subject_type');
|
||||||
$user = $request->user();
|
if ($subjectType == (new TaskHygiene)->getMorphClass()) {
|
||||||
|
$task = Task::findOrFail($id);
|
||||||
|
$taskable = $task->taskable;
|
||||||
|
if (!$taskable) {
|
||||||
|
throw new RuntimeException('任务不存在');
|
||||||
|
}
|
||||||
|
$check = $taskable->workflow;
|
||||||
|
if (!$check) {
|
||||||
|
throw new RuntimeException('审核记录不存在');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$check = WorkflowCheck::where('subject_type', $subjectType)->where('subject_id', $id)->firstOrFail();
|
||||||
|
}
|
||||||
|
$user = $this->guard()->user();
|
||||||
try {
|
try {
|
||||||
DB::beginTransaction();
|
DB::beginTransaction();
|
||||||
$log = $check->logs()->where('check_status', CheckStatus::Processing)->first();
|
$log = $check->logs()->where('check_status', CheckStatus::Processing)->first();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue