Browse Source

修改拉取微唯宝商品接口

sunxbiao 6 months ago
parent
commit
d204163654
1 changed files with 4 additions and 1 deletions
  1. 4 1
      app/controller/api/douhuomall/Take.php

+ 4 - 1
app/controller/api/douhuomall/Take.php

@@ -67,6 +67,9 @@ class Take
67
                 //sku信息处理
67
                 //sku信息处理
68
                 $skuInfo = $goodsInfo['sku_list'];
68
                 $skuInfo = $goodsInfo['sku_list'];
69
                 foreach ($skuInfo as $k => $v) {
69
                 foreach ($skuInfo as $k => $v) {
70
+                    if (empty($v['plat_price'])) {
71
+                        continue;
72
+                    }
70
                     $skuInfo[$k]['img_url'] = $this->seveImg($value['goods_id'], $v['main_img'], $targetDir);//规格图片
73
                     $skuInfo[$k]['img_url'] = $this->seveImg($value['goods_id'], $v['main_img'], $targetDir);//规格图片
71
                     $skuInfo[$k]['cost_price'] = bcadd($v['plat_price'], bcmul($v['plat_price'], 0.03, 2), 2);//成本价格 原来进价的基础上加百分之3
74
                     $skuInfo[$k]['cost_price'] = bcadd($v['plat_price'], bcmul($v['plat_price'], 0.03, 2), 2);//成本价格 原来进价的基础上加百分之3
72
                     $skuInfo[$k]['market_price'] = bcadd($skuInfo[$k]['cost_price'], bcmul($skuInfo[$k]['cost_price'], 0.2, 2), 2);//销售价格  售价在成本价格的基础上加百分20
75
                     $skuInfo[$k]['market_price'] = bcadd($skuInfo[$k]['cost_price'], bcmul($skuInfo[$k]['cost_price'], 0.2, 2), 2);//销售价格  售价在成本价格的基础上加百分20
@@ -145,7 +148,7 @@ class Take
145
             'slider_image' => $slider_image,
148
             'slider_image' => $slider_image,
146
         ];
149
         ];
147
         Db::name('store_product')->where('product_id', $product_id)->update($product_insert_data);
150
         Db::name('store_product')->where('product_id', $product_id)->update($product_insert_data);
148
-        echo '更新产品图片数据成功' . json_encode($product_insert_data);
151
+        // echo '更新产品图片数据成功' . json_encode($product_insert_data);
149
         $detail = $spuId_info['detail'];
152
         $detail = $spuId_info['detail'];
150
         if (!is_null(json_decode($detail))) {
153
         if (!is_null(json_decode($detail))) {
151
             $detail_list = json_decode($detail);
154
             $detail_list = json_decode($detail);