shish 2 éve
szülő
commit
97342f671d
1 módosított fájl, 19 hozzáadás és 16 törlés
  1. 19 16
      biz/ghs/classes/GhsClass.php

+ 19 - 16
biz/ghs/classes/GhsClass.php

@@ -209,39 +209,42 @@ class GhsClass extends BaseClass
             $list[$key]['shortAvatar'] = $avatar;
             $list[$key]['avatar'] = imgUtil::groupImg($avatar);
             $currentShopId = $val['shopId'] ?? 0;
+
+            $currentShop = $shopInfo[$currentShopId] ?? [];
+
             //新人福利和推荐福利
-            $xrFl = $shopInfo[$currentShopId]['xrFl'] ?? 0;
-            $xrFlAmount = $shopInfo[$currentShopId]['xrFlAmount'] ?? 0;
-            $tjFl = $shopInfo[$currentShopId]['tjFl'] ?? 0;
-            $tjFlAmount = $shopInfo[$currentShopId]['tjFlAmount'] ?? 0;
+            $xrFl = $currentShop['xrFl'] ?? 0;
+            $xrFlAmount = $currentShop['xrFlAmount'] ?? 0;
+            $tjFl = $currentShop['tjFl'] ?? 0;
+            $tjFlAmount = $currentShop['tjFlAmount'] ?? 0;
             $list[$key]['xrFl'] = $xrFl;
             $list[$key]['xrFlAmount'] = $xrFlAmount;
             $list[$key]['tjFl'] = $tjFl;
             $list[$key]['tjFlAmount'] = $tjFlAmount;
-            $list[$key]['miniKilo'] = $shopInfo[$currentShopId]['miniKilo'] ?? 0;
-            $list[$key]['kiloFee'] = $shopInfo[$currentShopId]['kiloFee'] ?? 0;
-            $list[$key]['presell'] = $shopInfo[$currentShopId]['presell'] ?? 0;
+            $list[$key]['miniKilo'] = $currentShop['miniKilo'] ?? 0;
+            $list[$key]['kiloFee'] = $currentShop['kiloFee'] ?? 0;
+            $list[$key]['presell'] = $currentShop['presell'] ?? 0;
             $isOpen = 0;
-            if (isset($shopInfo[$currentShopId])) {
-                $isOpen = ShopClass::isOpen($shopInfo[$currentShopId]);
+            if (!empty($currentShop)) {
+                $isOpen = ShopClass::isOpen($currentShop);
             }
             //营业状态
             $list[$key]['isOpen'] = $isOpen;
-            $list[$key]['openStartTime'] = $shopInfo[$currentShopId]['openStartTime'] ?? '';
-            $list[$key]['openEndTime'] = $shopInfo[$currentShopId]['openEndTime'] ?? '';
+            $list[$key]['openStartTime'] = $currentShop['openStartTime'] ?? '';
+            $list[$key]['openEndTime'] = $currentShop['openEndTime'] ?? '';
 
-            $list[$key]['meetNum'] = $shopInfo[$currentShopId]['meetNum'] ? floatval($shopInfo[$currentShopId]['meetNum']) : 0;
-            $list[$key]['meetAmount'] = $shopInfo[$currentShopId]['meetAmount'] ? floatval($shopInfo[$currentShopId]['meetAmount']) : 0;
-            $list[$key]['cutAmount'] = $shopInfo[$currentShopId]['cutAmount'] ? floatval($shopInfo[$currentShopId]['cutAmount']) : 0;
+            $list[$key]['meetNum'] = $currentShop['meetNum'] ? floatval($currentShop['meetNum']) : 0;
+            $list[$key]['meetAmount'] = $currentShop['meetAmount'] ? floatval($currentShop['meetAmount']) : 0;
+            $list[$key]['cutAmount'] = $currentShop['cutAmount'] ? floatval($currentShop['cutAmount']) : 0;
 
             $count = PurchaseClass::getCount(['ghsId' => $val['id'], 'debt' => PurchaseClass::DEBT_YES]);
             $list[$key]['debtNum'] = $count;
 
-            $pfLevel = $shopInfo[$currentShopId]['pfLevel'] ?? 0;
+            $pfLevel = $currentShop['pfLevel'] ?? 0;
             $list[$key]['pfLevel'] = $pfLevel;
 
             if (isset($val['mobile']) == false || empty($val['mobile'])) {
-                $mobile = $shopInfo[$currentShopId]['mobile'] ?? '';
+                $mobile = $currentShop['mobile'] ?? '';
                 $list[$key]['mobile'] = $mobile;
             }