alias("poster_apply") ->field("poster_apply.*") ->where(['poster_apply.user_id'=>$this->auth->id])->find(); $this->success("请求成功",$posterApply); } /** * 提交申请 */ public function submit(){ $name = $this->request->post("name"); $mobile = $this->request->post("mobile"); $card = $this->request->post("card"); $card_back = $this->request->post("card_back"); $hand_card = $this->request->post("hand_card",""); $posterApplyModel = new \app\admin\model\paotui\Posterapply(); $posterApply = $posterApplyModel->where(['user_id'=>$this->auth->id])->find(); if($posterApply){ if($posterApply['status'] != 1){ $posterApply->save([ 'name'=>$name, 'mobile'=>$mobile, 'card'=>$card, 'card_back'=>$card_back, 'hand_card'=>$hand_card, ]); } }else{ $posterApplyModel = new \app\admin\model\paotui\Posterapply(); $posterApplyModel->save([ 'user_id'=>$this->auth->id, 'name'=>$name, 'mobile'=>$mobile, 'card'=>$card, 'card_back'=>$card_back, 'hand_card'=>$hand_card ]); } $this->success("请求成功"); } }