Ver Fonte

美团对接-商品对接

fang há 1 ano atrás
pai
commit
f62bba22fb
1 ficheiros alterados com 9 adições e 8 exclusões
  1. 9 8
      app/adminapi/controller/third/ThirdGoodsController.php

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

@@ -131,18 +131,19 @@ class ThirdGoodsController extends BaseAdminController
             foreach ($data as $key=>$items){
                 if(in_array($items['dealGroupId'], $product_ids)){
                     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)){
-                $result = ThirdGoodsLogic::addMeituanGoods($good_data);
+                ThirdGoodsLogic::addMeituanGoods($good_data);
             }
         }
         return $this->success('同步成功', [], 1, 1);