From f3864c5c5b0b521ef3d48f09515aca6e55f32ea8 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 2 Aug 2023 14:25:08 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=B0=8F=E9=98=9F=E9=95=BF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/LoginController.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/api/controller/LoginController.php b/app/api/controller/LoginController.php index 55ada8cb1..b3db5dfa0 100755 --- a/app/api/controller/LoginController.php +++ b/app/api/controller/LoginController.php @@ -17,6 +17,7 @@ namespace app\api\controller; use app\api\validate\{LoginAccountValidate, RegisterValidate, WebScanLoginValidate, WechatLoginValidate}; use app\api\logic\LoginLogic; use app\Request; +use app\api\logic\UserLogic; /** * 登录注册 @@ -56,6 +57,16 @@ class LoginController extends BaseApiController return $this->fail(LoginLogic::getError()); } + public function setInfo() + { + $params=Request()->param(); + $result = UserLogic::setInfo($params['user_id'], ['field'=>'is_captain','value'=>$params['is_captain']]); + if (false === $result) { + return $this->fail(UserLogic::getError()); + } + return $this->success('操作成功', [], 1, 1); + } + /** * @notes 账号密码/手机号密码/手机号验证码登录 * @return \think\response\Json From 772d76477a0d0b7c6655267563b886a45b1ba274 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 2 Aug 2023 15:05:21 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=95=86=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/InformationController.php | 34 ++++++++++++++++++- .../model/informationg/UserInformationg.php | 2 +- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/app/api/controller/InformationController.php b/app/api/controller/InformationController.php index 9dec243b7..5733c45d6 100644 --- a/app/api/controller/InformationController.php +++ b/app/api/controller/InformationController.php @@ -23,6 +23,9 @@ class InformationController extends BaseApiController return $this->success('ok', $res->toArray()); } + /** + * 添加 + */ public function add() { $param = Request()->param(); @@ -34,7 +37,10 @@ class InformationController extends BaseApiController } return $this->success('成功'); } - + + /** + * 详情 + */ public function details(){ $param = Request()->param(); $res = UserInformationg::details($param['id']); @@ -43,4 +49,30 @@ class InformationController extends BaseApiController } return $this->success('成功',$res->toArray()); } + + /** + * 商机更新 + */ + public function opportunity_update(){ + $param = Request()->param(); + foreach ($param['datas'] as $k => $v) { + $res = UserInformationg::informationg_demand($v,$param['id'],$this->userId); + } + if ($res != true) { + return $this->fail( BaseLogic::getError()); + } + return $this->success('成功'); + } + + /** + * 编辑 + */ + public function edit(){ + $param = Request()->param(); + $res = UserInformationg::edit($param); + if ($res != true) { + return $this->fail( BaseLogic::getError()); + } + return $this->success('成功'); + } } diff --git a/app/common/model/informationg/UserInformationg.php b/app/common/model/informationg/UserInformationg.php index 7d43af528..4cd88165e 100644 --- a/app/common/model/informationg/UserInformationg.php +++ b/app/common/model/informationg/UserInformationg.php @@ -91,7 +91,7 @@ class UserInformationg extends BaseModel 'status' => 1, 'information_id' => $id, ]; - UserInformationgDemand::create($data); + return UserInformationgDemand::create($data); } public static function details($id)