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);