Browse Source

建议零售价调整

牟新芬 3 years ago
parent
commit
2c9e68395e
1 changed files with 3 additions and 3 deletions
  1. 3 3
      app/api/controller/v1/Index.php

+ 3 - 3
app/api/controller/v1/Index.php

@@ -52,7 +52,7 @@ class Index extends BaseController
             if($v['price'] == 0) {
                 $data['list'][$k]['price'] = round($v['ot_price'] * 1.15, 2);
             }
-            $data['list'][$k]['market_price'] = round($data['list'][$k]['price'] * 1.3, 2);
+            $data['list'][$k]['market_price'] = round($data['list'][$k]['price'] * 1.2, 2);
             $score = Db::name("product_score")->where('product_id', $v['id'])->find();
             if($score) {
                 $attr = json_decode($score['attribute'], true);
@@ -67,7 +67,7 @@ class Index extends BaseController
                     $max = $attr[2]['ks'];
                 if($attr[2]['other'] > $max)
                     $max = $attr[2]['other'];
-                if($max)
+                if($max && $max > $data['list'][$k]['market_price'])
                     $data['list'][$k]['market_price'] = $max;
             }
             if($v['label'] != ""){
@@ -116,7 +116,7 @@ class Index extends BaseController
                 $max = $attr[2]['ks'];
             if($attr[2]['other'] > $max)
                 $max = $attr[2]['other'];
-            if($max)
+            if($max && $max > $storeInfo['market_price'])
                 $storeInfo['market_price'] = $max;
         }
         $data['storeInfo'] = $storeInfo;