all(); $params['processor'] = Auth::user()['id']; $demandProcess = DemandProcess::query()->create($params); $demandProcess->loadMissing('user'); $this->success($demandProcess); } /** * @param DemandProcessRequest $request * @throws \Exception */ public function destroyApi(DemandProcessRequest $request) { $demandProcess = DemandProcess::query()->where('id',$request['id'])->first(); if($demandProcess['processor']!==Auth::user()['id'])$this->error('非当前过程创建人不可删除'); try { $bool = $demandProcess->delete(); if($bool)$this->success(); $this->error('删除失败'); } catch (\Exception $e) { $this->error('删除异常'.$e->getMessage()); } } }