'; public function title() { if ($this->title) { return $this->title.' 开始任务'; } return '开始任务'; } /** * @param Model|Authenticatable|HasPermissions|null $user * * @return bool */ protected function authorize($user): bool { return $user->can('dcat.admin.quota_v2_send_jobs.start'); } /** * Handle the action request. * * @param Request $request * * @return Response */ public function handle(Request $request) { try { QuotaV1SendJob::findOrFail($this->getKey())->update([ 'status' => QuotaV1SendJob::STATUS_DOING, ]); } catch (Throwable $th) { report($th); return $this->response()->error('开始失败,'.$th->getMessage())->refresh(); } return $this->response()->success('操作成功')->refresh(); } /** * @return string|array|void */ public function confirm() { return ['确认开始执行当前任务?', '确认后将针对任务金额开始分红,无法逆转。']; } }