Ver código fonte

fix(product): 修复产品排序逻辑

- 在排序规则中添加 create_time 降序排列
- 确保产品列表按 sort 和创建时间双重排序
- 解决了产品显示顺序不一致的问题
shichen 2 meses atrás
pai
commit
97b36425e7
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      app/common/dao/store/product/ProductDao.php

+ 1 - 1
app/common/dao/store/product/ProductDao.php

@@ -168,7 +168,7 @@ class ProductDao extends BaseDao
168 168
                 $query->order('rank DESC ,create_time DESC');
169 169
             });
170 170
         },function ($query){
171
-            $query->order('sort DESC');
171
+            $query->order('sort DESC ,create_time DESC');
172 172
         });
173 173
         return $query;
174 174
     }