From 5835271186d087e8c9a7b004b9c5c3edd7fb0ebe Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Tue, 9 Jul 2024 15:15:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E7=94=A8=E6=88=B7ID=E5=88=A4=E6=96=AD=E8=B4=AD=E7=89=A9?= =?UTF-8?q?=E8=BD=A6=E5=95=86=E5=93=81=E6=98=AF=E5=90=A6=E5=8F=82=E4=B8=8E?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/store/lists/cart/CartList.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/app/store/lists/cart/CartList.php b/app/store/lists/cart/CartList.php index e84943654..094acfd06 100644 --- a/app/store/lists/cart/CartList.php +++ b/app/store/lists/cart/CartList.php @@ -42,7 +42,6 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists */ public function lists($where = []): array { - $userId = $this->request->get('uid'); $where = [ 'staff_id' => $this->adminId, 'is_pay' => 0 @@ -55,9 +54,19 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists return $item; }) ->toArray(); -// $off_activity = Config::where('name', 'off_activity')->value('value'); + $off_activity = Config::where('name', 'off_activity')->value('value'); $off_activity = 0; $this->off_activity = $off_activity; + $uid = 0; + if ($this->request->get('uid')) { + $uid = $this->request->get('uid'); + } + if ($uid > 0) { + $user_ship = User::where('id', $uid)->value('user_ship'); + if (in_array($user_ship, [4, 5, 6, 7])) { + $off_activity = 1; + } + } foreach ($list as $key => &$item) { $find = StoreBranchProduct::where(['product_id' => $item['product_id'], 'store_id' => $item['store_id']]) ->field('product_id,image,price,cost,store_name,unit,delete_time,vip_price') @@ -65,10 +74,10 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists ->find(); if ($find) { - if($off_activity==1){ - $this->activity_price = bcadd(bcmul($find['cost'],$item['cart_num'], 2), $this->activity_price, 2); + if ($off_activity == 1) { + $this->activity_price = bcadd(bcmul($find['cost'], $item['cart_num'], 2), $this->activity_price, 2); $item['price'] = $find['cost']; - }else{ + } else { $item['price'] = $find['price']; } $item['goods_total_price'] = bcmul($item['cart_num'], $find['price'], 2);