WIN-2308041133\Administrator 5 ay önce
ebeveyn
işleme
d72d288cb5
1 değiştirilmiş dosya ile 10 ekleme ve 12 silme
  1. 10 12
      app/models/store/StoreProduct.php

+ 10 - 12
app/models/store/StoreProduct.php

@@ -58,7 +58,7 @@ class StoreProduct extends BaseModel
         return htmlspecialchars_decode($value);
     }
 
-    public static function getValidProduct($productId, $field = 'min_integral,max_integral,add_time,browse,cate_id,code_path,cost,ficti,give_integral,id,image,is_sub,is_bargain,is_benefit,is_best,is_del,is_hot,is_new,is_postage,is_seckill,is_show,is_Inclusive,is_points,is_explosive,keyword,mer_id,mer_use,ot_price,postage,price,sales,slider_image,sort,stock,store_info,store_name,unit_name,vip_price,spec_type,IFNULL(sales,0) + IFNULL(ficti,0) as fsales,video_link')
+    public static function getValidProduct($productId, $field = 'min_integral,max_integral,add_time,browse,cate_id,code_path,cost,ficti,give_integral,id,image,is_sub,is_bargain,is_benefit,is_best,is_del,is_hot,is_new,is_postage,is_seckill,is_show,is_inclusive,is_points,is_explosive,keyword,mer_id,mer_use,ot_price,postage,price,sales,slider_image,sort,stock,store_info,store_name,unit_name,vip_price,spec_type,IFNULL(sales,0) + IFNULL(ficti,0) as fsales,video_link')
     {
         $Product = self::where('is_del', 0)->where('is_show', 1)->where('id', $productId)->field($field)->find();
         if ($Product) return $Product->toArray();
@@ -288,19 +288,17 @@ class StoreProduct extends BaseModel
             else
                 return $isSingle ? $list : 0;
         //当$list为数组时$isSingle==true为一维数组 ,否则为二维
-        if ($isSingle){
-            @file_put_contents('quanju.txt',  json_encode($list)."-4\r\n", 8);
-            $list['vip_price'] = isset($list['price']) ? bcsub($list['price'], bcmul($discount, $list['price'], 2), 2) : 0;
-        }
-//            if ($list['is_Inclusive']==0&&$list['is_points']==0&&$list['is_explosive']==0){
+        if ($isSingle) {
+            if ($list['is_Inclusive'] == 0 && $list['is_points'] == 0 && $list['is_explosive'] == 0) {
 
-//            }
-        else{
+                $list['vip_price'] = isset($list['price']) ? bcsub($list['price'], bcmul($discount, $list['price'], 2), 2) : 0;
+            }
+        } else {
             foreach ($list as &$item) {
-//                if ($item['is_Inclusive']==0&&$item['is_points']==0&&$item['is_explosive']==0){
-                @file_put_contents('quanju.txt',  json_encode($item)."-5\r\n", 8);
-                $item['vip_price'] = isset($item['price']) ? bcsub($item['price'], bcmul($discount, $item['price'], 2), 2) : 0;
-//                }
+                if ($item['is_Inclusive'] == 0 && $item['is_points'] == 0 && $item['is_explosive'] == 0) {
+//                @file_put_contents('quanju.txt',  json_encode($item)."-5\r\n", 8);
+                    $item['vip_price'] = isset($item['price']) ? bcsub($item['price'], bcmul($discount, $item['price'], 2), 2) : 0;
+                }
             }
         }