model = new Shenhe; if (!Config::get('fastadmin.usercenter')) { $this->error(__('User center already closed')); } } /** * 提交审核 */ public function setshenhe() { $data = $this->request->post(); if ($this->request->isPost()){ $insert['user_id'] = $this->auth->id; $insert['realname'] = $data['realname']; $insert['cardno'] = $data['cardno']; $insert['cardno_z'] = $data['cardno_z']; $insert['cardno_f'] = $data['cardno_f']; $insert['createtime'] = date("Y-m-d H:i:s",time()); if($this->model->insert($insert)) { return $this->success('提交成功,待管理审核'); }else{ return $this->error('提交失败,请重新提交'); } } return $this->error('非法请求'); } public function getinfo(){ $uid = $this->auth->id; $info = $this->model->where('user_id',$uid)->order(['id'=>'desc'])->find(); if(!$info){ $info['status'] = -2; } return $this->success('获取成功',$info); } }