From 25e85e7cbd74bd5569ddb37a2958c6c8f185edd2 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 17:46:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=99=A8=E7=9A=84=E7=9F=AD=E4=BF=A1=E5=8F=91?= =?UTF-8?q?=E9=80=81=E3=80=81=E6=B7=BB=E5=8A=A0=E3=80=81=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E3=80=81=E4=BC=9A=E5=91=98=E8=AE=BE=E7=BD=AE=E5=92=8C=E5=85=85?= =?UTF-8?q?=E5=80=BC=E5=88=97=E8=A1=A8=E7=AD=89=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/store/controller/user/UserController.php | 90 +++++++------------- 1 file changed, 30 insertions(+), 60 deletions(-) diff --git a/app/store/controller/user/UserController.php b/app/store/controller/user/UserController.php index 66dfd229..6679b6b1 100644 --- a/app/store/controller/user/UserController.php +++ b/app/store/controller/user/UserController.php @@ -9,6 +9,7 @@ use app\store\controller\BaseAdminController; use app\store\lists\user\UserLists; use app\admin\logic\user\UserLogic; use app\admin\validate\user\UserValidate; +use app\api\controller\user\UserRechargeController; use app\common\model\user\User; use support\Cache; @@ -26,36 +27,34 @@ class UserController extends BaseAdminController */ public function archives_sms() { - $mobile = $this->request->post('mobile',''); + $mobile = $this->request->post('mobile', ''); if (empty($mobile)) return $this->fail('手机号缺失'); - $res = (new \app\api\logic\user\UserLogic())->dealReportingSms($mobile,'_userArchives'); - if ($res){ + $res = (new \app\api\logic\user\UserLogic())->dealReportingSms($mobile, '_userArchives'); + if ($res) { return $this->success('发送成功'); } return $this->fail('发送失败'); - } public function add() { $params = (new UserValidate())->post()->goCheck('storeAdd'); $code = $params['code']; -// if($code && $params['mobile']){ -// $remark = $params['mobile'].'_userArchives'; -// $codeCache = Cache::get($remark); -// if(empty($codeCache)){ -// return $this->fail('验证码不存在'); -// } -// if ($codeCache != $code) { -// return $this->fail('验证码错误'); -// } -// } - UserLogic::StoreAdd($params); - if (UserLogic::hasError() ) { + // if($code && $params['mobile']){ + // $remark = $params['mobile'].'_userArchives'; + // $codeCache = Cache::get($remark); + // if(empty($codeCache)){ + // return $this->fail('验证码不存在'); + // } + // if ($codeCache != $code) { + // return $this->fail('验证码错误'); + // } + // } + UserLogic::StoreAdd($params); + if (UserLogic::hasError()) { return $this->fail(UserLogic::getError()); } return $this->success('添加成功', [], 1, 1); - } public function detail() @@ -65,57 +64,28 @@ class UserController extends BaseAdminController return $this->success('', $detail); } - public function user_ship(){ - $user_ship=$this->request->post('user_ship',0); - $id=$this->request->post('id',0); - if($user_ship==1){ - return $this->fail('充值会员不能前端设置'); + public function user_ship() + { + $user_ship = $this->request->post('user_ship', 0); + $id = $this->request->post('id', 0); + if ($user_ship == 1) { + return $this->fail('充值会员不能前端设置'); } - User::where('id',$id)->update(['user_ship'=>$user_ship]); + User::where('id', $id)->update(['user_ship' => $user_ship]); return $this->success('设置成功'); } - public function user_label(){ - $label_id=$this->request->post('label_id',0); - $id=$this->request->post('id',0); + public function user_label() + { + $label_id = $this->request->post('label_id', 0); + $id = $this->request->post('id', 0); - User::where('id',$id)->update(['label_id'=>$label_id]); + User::where('id', $id)->update(['label_id' => $label_id]); return $this->success('设置成功'); } public function recharge_list() { - $buy_bar = "元采购包"; - $send_bar = "品牌礼品券"; - $arr = [ - [ - 'money'=>1,//采购包 - 'send'=>249,//礼品券 - 'money_string'=>$buy_bar, - 'send_string'=>$send_bar, - ], - [ - 'money'=>2,//采购包 - 'send'=>560,//礼品券 - 'money_string'=>$buy_bar, - 'send_string'=>$send_bar, - ], - [ - 'money'=>5,//采购包 - 'send'=>1550,//礼品券 - 'money_string'=>$buy_bar, - 'send_string'=>$send_bar, - ], - [ - 'money'=>10,//采购包 - 'send'=>3500,//礼品券 - 'money_string'=>$buy_bar, - 'send_string'=>$send_bar, - ] - ]; - return $this->success('ok',$arr); - - + return (new UserRechargeController())->recharge_list(); } - -} \ No newline at end of file +}