From 9d1d309a2f1cc743d00033152d41eb8308488fe8 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Tue, 21 May 2024 09:08:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/operation/OpurchaseclassController.php | 10 ++++++---- app/api/controller/shop/IndexController.php | 2 +- app/api/controller/user/UserWithdrawController.php | 1 - app/api/logic/shop/ShopLogic.php | 5 ++++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/admin/controller/operation/OpurchaseclassController.php b/app/admin/controller/operation/OpurchaseclassController.php index 67f4e69..2846f2a 100644 --- a/app/admin/controller/operation/OpurchaseclassController.php +++ b/app/admin/controller/operation/OpurchaseclassController.php @@ -96,15 +96,17 @@ class OpurchaseclassController extends BaseAdminController $where['is_push'] = $is_push; $res = Opurchaseinfo::where($where)->page($page_no, $page_size)->select() ->each(function ($item) { - $item['sys_labels_arr']=''; $find = Goods::where('id', $item['goods'])->with('unitName')->find(); if($find){ $item['goods_name'] = $find['name']; $item['unit_name'] = $find['unit_name']; - $goodslabel = GoodsLabel::where('id','in',$find['sys_labels'])->column('id,name'); - $item['sys_labels_arr'] = $goodslabel; - } + $where = [ + 'goods_id' => $item['goods'], + 'order_id' => $item['pid'], + 'is_adopt' => 1 + ]; + $item['nums_count'] = OpurchaseGoodsOffer::where($where)->sum('nums'); }); $data['count'] = Opurchaseinfo::where($where)->count(); diff --git a/app/api/controller/shop/IndexController.php b/app/api/controller/shop/IndexController.php index 8abe369..9785c36 100644 --- a/app/api/controller/shop/IndexController.php +++ b/app/api/controller/shop/IndexController.php @@ -22,7 +22,7 @@ class IndexController extends BaseApiController{ if (strpos($token, 'Bearer') === 0){ $token = trim(substr($token, 6)); } - $res=ShopLogic::auth($token); + $res=ShopLogic::auth($token,$jg_register_id); if(ShopLogic::hasError()||$res==false){ return $this->fail('没有授权信息'); }else{ diff --git a/app/api/controller/user/UserWithdrawController.php b/app/api/controller/user/UserWithdrawController.php index 5d055e4..f4ba108 100644 --- a/app/api/controller/user/UserWithdrawController.php +++ b/app/api/controller/user/UserWithdrawController.php @@ -15,7 +15,6 @@ { //获取用户余额和绑定银行账户信息 public function amount_account(){ - d($this->request->userInfo); $uid = $this->request->userInfo['user_id']; $merchant = Merchant::where('uid',$uid)->findOrEmpty(); $supplier = Supplier::where('uid',$uid)->findOrEmpty(); diff --git a/app/api/logic/shop/ShopLogic.php b/app/api/logic/shop/ShopLogic.php index 796a8cb..66722cb 100644 --- a/app/api/logic/shop/ShopLogic.php +++ b/app/api/logic/shop/ShopLogic.php @@ -9,7 +9,7 @@ use think\facade\Db; class ShopLogic extends BaseLogic { - public static function auth($token) + public static function auth($token,$jg_register_id='') { list(, $base64UrlPayload,) = explode('.', $token); $payload = base64UrlDecode($base64UrlPayload); @@ -26,6 +26,9 @@ class ShopLogic extends BaseLogic return $userSession['token']; } $userInfo = UserTokenService::setToken($user['user_id'], 6); + if($jg_register_id){ + Db::name('user_auth_shop')->where('id',$user['id'])->update(['jg_register_id'=>$jg_register_id]); + } return $userInfo['token']; } }