Commit d11cc855 by 汪伟伟

删除任务判断

parent 8ebc23bf
...@@ -359,5 +359,17 @@ class TaskController extends AdminController ...@@ -359,5 +359,17 @@ class TaskController extends AdminController
return $form->response()->success('操作成功')->redirect('tasks'); return $form->response()->success('操作成功')->redirect('tasks');
} }
public function destroy($id)
{
$idArr = explode(',',$id);
foreach ($idArr as $idv){
if (TasksReceive::query()->where('task_id',$idv)->exists()){
$task = \App\Models\Task::query()->find($idv);
return $this->form()->response()->error('已经有用户领取了任务,不允许删除,任务名称:'.$task->name.' '.CityAreaService::getAreaName($task->city_id).' '.$task->year);
}
}
return $this->form()->destroy($id);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment