Explorar el Código

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

- 在排序规则中添加 create_time 降序排列
- 确保产品列表按 sort 和创建时间双重排序
- 解决了产品显示顺序不一致的问题
shichen hace 2 meses
padre
commit
97b36425e7
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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
                 $query->order('rank DESC ,create_time DESC');
168
                 $query->order('rank DESC ,create_time DESC');
169
             });
169
             });
170
         },function ($query){
170
         },function ($query){
171
-            $query->order('sort DESC');
171
+            $query->order('sort DESC ,create_time DESC');
172
         });
172
         });
173
         return $query;
173
         return $query;
174
     }
174
     }