【程序目录】优化热销产品按照销量排序

This commit is contained in:
evoxwht 2022-04-06 16:25:26 +08:00
parent 8d098b5484
commit 85483987b7

View File

@ -223,7 +223,7 @@ class StoreProductDao extends BaseDao
->when($limit, function ($query) use ($limit) {
$query->limit($limit);
})
->order('sort DESC, id DESC')->select()->toArray();
->order(($field == 'is_hot' ? 'sales DESC' : 'sort DESC') . ', id DESC')->select()->toArray();
}