cqp il y a 1 mois
Parent
commit
193b181188
1 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. 4 4
      app/Service/ProductService.php

+ 4 - 4
app/Service/ProductService.php

@@ -1163,11 +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');
+                ->orderByDesc('product_attribute')
+                ->orderByDesc('item_code');
         }else{
-            $model = $model->orderByDesc('item_code')
-                ->orderByDesc('product_attribute');
+            $model = $model->orderByDesc('product_attribute')
+                ->orderByDesc('item_code');
         }
 
         if(! empty($data['title_t'])) {