shish 3 лет назад
Родитель
Сommit
983a1be4e5
1 измененных файлов с 16 добавлено и 19 удалено
  1. 16 19
      biz-ghs/product/classes/ProductClass.php

+ 16 - 19
biz-ghs/product/classes/ProductClass.php

@@ -309,22 +309,22 @@ class ProductClass extends BaseClass
             $smallPrice = bcmul($smallPrice, $smallRatio, 2);
             $list[$k]['smallPrice'] = $smallPrice;
 
-            $presellDate = $v['presellDate'] ?? '';
-            $presellDateList = [];
-            $presellDateShow = [];
-            if (!empty($presellDate)) {
-                $dateArr = explode(',', trim($presellDate));
+            $preSellDate = $v['presellDate'] ?? '';
+            $preSellDateList = [];
+            $preSellDateShow = [];
+            if (!empty($preSellDate)) {
+                $dateArr = explode(',', trim($preSellDate));
                 if (!empty($dateArr)) {
                     foreach ($dateArr as $sellTime) {
                         $sellDate = date("Y-m-d", $sellTime);
                         $showDate = date("n月j日", $sellTime);
-                        $presellDateList[] = $sellDate;
-                        $presellDateShow[] = $showDate;
+                        $preSellDateList[] = $sellDate;
+                        $preSellDateShow[] = $showDate;
                     }
                 }
             }
-            $list[$k]['presellDateList'] = $presellDateList;
-            $list[$k]['presellDateShow'] = $presellDateShow;
+            $list[$k]['presellDateList'] = $preSellDateList;
+            $list[$k]['presellDateShow'] = $preSellDateShow;
 
             //这个很重要不能随意乱改
             $autoPrice = bcadd($v['cost'], $v['addPrice'], 2);
@@ -358,6 +358,7 @@ class ProductClass extends BaseClass
             $ratio = isset($v['ratio']) && $v['ratio'] > 0 ? $v['ratio'] : 1;
             $list[$k]['cover'] = $cover;
             $list[$k]['prePrice'] = $v['price'] ?? 0;
+            $list[$k]['itemName'] = $v['name'] ?? '';
 
             //今日特价、会员价
             $price = self::getFinalPrice($v, $level, $priceMap, $addPriceMap);
@@ -381,22 +382,18 @@ class ProductClass extends BaseClass
             $smallPrice = bcmul($smallPrice, $smallRatio, 2);
             $list[$k]['smallPrice'] = $smallPrice;
 
-            $presellDate = $v['presellDate'] ?? '';
-            $presellDateList = [];
-            $presellDateShow = [];
-            if (!empty($presellDate)) {
-                $dateArr = explode(',', trim($presellDate));
+            $preSellDate = $v['presellDate'] ?? '';
+            $preSellDateShow = [];
+            if (!empty($preSellDate)) {
+                $dateArr = explode(',', trim($preSellDate));
                 if (!empty($dateArr)) {
                     foreach ($dateArr as $sellTime) {
-                        $sellDate = date("Y-m-d", $sellTime);
                         $showDate = date("n月j日", $sellTime);
-                        $presellDateList[] = $sellDate;
-                        $presellDateShow[] = $showDate;
+                        $preSellDateShow[] = $showDate;
                     }
                 }
             }
-            $list[$k]['presellDateList'] = $presellDateList;
-            $list[$k]['presellDateShow'] = $presellDateShow;
+            $list[$k]['presellDateShow'] = $preSellDateShow;
         }
         return $list;
     }