Просмотр исходного кода

Merge branch 'master' into clear_collect

tangyuanwang 6 дней назад
Родитель
Сommit
616a691cfd
1 измененных файлов с 9 добавлено и 11 удалено
  1. 9 11
      app/Http/Controllers/Manager/Collect/Product.php

+ 9 - 11
app/Http/Controllers/Manager/Collect/Product.php

@@ -501,16 +501,15 @@ class Product extends Controller
             $platforms = $platform_string ?  explode(',', $platform_string) : '';
             $platforms = $platforms ? array_unique($platforms) : '';
 
-            $platform_data = $ProductModel->platform_data();
-            if (!empty($platforms) && $platforms != '')  {
-                foreach ($platforms as $platform) {
-                    $product_specs_log = $ProductModel
-                        ->whereRaw("FIND_IN_SET(?, platform)", [$platform])
-                        ->where(['product_brand' => $Product->product_brand, 'product_name' => $Product->product_name, 'status' => '0', 'company_id' => $Product->company_id])
-                        ->where('id', '!=', $id)
-                        ->where(function ($query) use ($product_specs) {
-                            // 平台条件(固定)
-                            $query->where(function ($query_li) use ($product_specs) {
+            $platform_data = $ProductModel->platform_index_data();
+            foreach ($platforms as $platform) {
+                $product_specs_log = $ProductModel
+                    ->whereRaw("FIND_IN_SET(?, platform)", [$platform])
+                    ->where(['product_brand' => $Product->product_brand, 'product_name' => $Product->product_name, 'status' => '0', 'company_id' => $Product->company_id])
+                    ->where('id', '!=', $id)
+                    ->where(function ($query) use ($product_specs) {
+                        // 平台条件(固定)
+                        $query->where(function ($query_li) use ($product_specs) {
 
                                 foreach ($product_specs as $product_spec) {
                                     if (empty($product_specs)) continue;
@@ -524,7 +523,6 @@ class Product extends Controller
                     }
                 }
             }
-        }
         // 执行修改
         $result            =  $ProductModel->changeStatus($Product, $status);
         // 提示新增失败