service = new InvRequisitionService(); } /** * 提交物品申请 * * @param Request $request * @return mixed */ public function apply(Request $request) { try { // 验证申请数据 $data = $this->validate($this->service->getValidator(), $request->post(), 'apply'); // 处理申请逻辑 $result = $this->service->serviceStore($request, $data, 'apply'); return $this->success($result, '申请提交成功'); } catch (\Throwable $e) { return $this->error($e->getMessage()); } } /** * 列表页数据格式化 * * @param array $data * @return array */ // protected function indexFormat($data) // { // if (isset($data['created_at'])) // $data['created_at'] = date('Y-m-d H:i:s', $data['created_at']); // if (isset($data['updated_at'])) // $data['updated_at'] = date('Y-m-d H:i:s', $data['updated_at']); // return $data; // } }