shish 3 лет назад
Родитель
Сommit
c4fc476c44
1 измененных файлов с 15 добавлено и 10 удалено
  1. 15 10
      biz-ghs/product/classes/ProductClass.php

+ 15 - 10
biz-ghs/product/classes/ProductClass.php

@@ -969,6 +969,17 @@ class ProductClass extends BaseClass
                 if (empty($chainProduct)) {
                 if (empty($chainProduct)) {
                     continue;
                     continue;
                 }
                 }
+
+                //加盟店仅同步名称等非重要参数
+                if ($chainShop->join == 1) {
+                    unset($params['skPrice']);
+                    unset($params['skMore']);
+                    unset($params['price']);
+                    unset($params['addPrice']);
+                    self::updateById($chainProduct->id, $params);
+                    continue;
+                }
+
                 if ($price != $chainProduct->price) {
                 if ($price != $chainProduct->price) {
                     //花店价有变化
                     //花店价有变化
                     self::changeSinglePrice($chainShop, $ptItemId, $price, $currentSkPrice, $changeParams2);
                     self::changeSinglePrice($chainShop, $ptItemId, $price, $currentSkPrice, $changeParams2);
@@ -980,16 +991,10 @@ class ProductClass extends BaseClass
                         unset($params['price']);
                         unset($params['price']);
                     }
                     }
                 }
                 }
-                if (isset($chainShop->join) && $chainShop->join == 1) {
-                    //加盟店仅同步名称等非重要因素
-                    if (isset($params['name'])) {
-                        $jmParams = ['name' => $params['name']];
-                        self::updateById($chainProduct->id, $jmParams);
-                    }
-                } else {
-                    //直营店同步价格等重要因素
-                    self::updateById($chainProduct->id, $params);
-                }
+
+                //直营店同步价格等重要因素
+                self::updateById($chainProduct->id, $params);
+
             }
             }
         }
         }