services = $services; } /** * 投诉列表 */ public function listComplaint(Request $request) { $uid = (int)$request->uid(); return app('json')->success($this->services->getCrudListIndex(['user_id', $uid])); } /** * 投诉详情 */ public function detailsComplaint(Request $request) { } /** * 添加投诉 */ public function addComplaint(Request $request) { $data = $request->postMore([ ['content', ''] ]); if (empty($data['content'])) { return app('json')->fail(100100); } $user = $request->user()->toArray(); // echo '
'; // var_dump($user); // return false; $data['school_id'] = $user['school_id']; $data['user_id'] = $user['uid']; $data['user_name'] = $user['real_name']; $data['school_name'] = $this->services->getSchoolData($user['school_id'])['school_name']; $this->services->crudSave($data); return app('json')->success(100017); } }