Jelajahi Sumber

产品集合

cqp 6 bulan lalu
induk
melakukan
8a407a1aa8
1 mengubah file dengan 3 tambahan dan 1 penghapusan
  1. 3 1
      app/Service/ProductService.php

+ 3 - 1
app/Service/ProductService.php

@@ -1163,9 +1163,11 @@ class ProductService extends Service
             //先根据大类分类排序 然后再根据子类分类排序 然后再根据产品属性排序
             $model = $model->orderByRaw("CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(product_category, ',', 1), '[', -1) AS UNSIGNED)")
                 ->orderByRaw("CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(product_category, ',', 2), ',', -1) AS UNSIGNED)")
+                ->orderByDesc('item_code')
                 ->orderByDesc('product_attribute');
         }else{
-            $model = $model->orderByDesc('product_attribute');
+            $model = $model->orderByDesc('item_code')
+                ->orderByDesc('product_attribute');
         }
 
         if(! empty($data['title_t'])) {