Kaynağa Gözat

美团对接-商品对接

fang 1 yıl önce
ebeveyn
işleme
f62bba22fb

+ 9 - 8
app/adminapi/controller/third/ThirdGoodsController.php

@@ -131,18 +131,19 @@ class ThirdGoodsController extends BaseAdminController
             foreach ($data as $key=>$items){
             foreach ($data as $key=>$items){
                 if(in_array($items['dealGroupId'], $product_ids)){
                 if(in_array($items['dealGroupId'], $product_ids)){
                     unset($data[$key]);
                     unset($data[$key]);
+                }else{
+                    $good_data[] = [
+                        'third_type' => 1,
+                        'goods_id' => 0,
+                        'product_id' => $items['dealGroupId'],
+                        'product_name' => $items['title'],
+                        'product_price' => $items['price'],
+                    ];
                 }
                 }
-                $good_data[] = [
-                    'third_type' => 1,
-                    'goods_id' => 0,
-                    'product_id' => $items['dealGroupId'],
-                    'product_name' => $items['title'],
-                    'product_price' => $items['price'],
-                ];
             }
             }
 
 
             if(!empty($good_data)){
             if(!empty($good_data)){
-                $result = ThirdGoodsLogic::addMeituanGoods($good_data);
+                ThirdGoodsLogic::addMeituanGoods($good_data);
             }
             }
         }
         }
         return $this->success('同步成功', [], 1, 1);
         return $this->success('同步成功', [], 1, 1);