fix: 产品分类排序
This commit is contained in:
@@ -104,7 +104,7 @@ class Product extends Common
|
|||||||
->onSale(true)
|
->onSale(true)
|
||||||
->onShelves(true)
|
->onShelves(true)
|
||||||
->append(['p' => $list[0]['id']])
|
->append(['p' => $list[0]['id']])
|
||||||
->order(['sort' => 'asc', 'id' => 'desc'])
|
->order(['sort' => 'asc', 'created_at' => 'desc', 'id' => 'desc'])
|
||||||
->limit(5)
|
->limit(5)
|
||||||
->buildSql();
|
->buildSql();
|
||||||
$query = \think\facade\Db::table("($sql) as a");
|
$query = \think\facade\Db::table("($sql) as a");
|
||||||
@@ -126,7 +126,7 @@ class Product extends Common
|
|||||||
->enabled(true)
|
->enabled(true)
|
||||||
->onSale(true)
|
->onSale(true)
|
||||||
->onShelves(true)
|
->onShelves(true)
|
||||||
->order(['sort' => 'asc', 'id' => 'desc'])
|
->order(['sort' => 'asc', 'created_at' => 'desc', 'id' => 'desc'])
|
||||||
->limit(5);
|
->limit(5);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -192,7 +192,7 @@ class Product extends Common
|
|||||||
->enabled(true)
|
->enabled(true)
|
||||||
->onSale(true)
|
->onSale(true)
|
||||||
->onShelves(true)
|
->onShelves(true)
|
||||||
->order(['sort' => 'asc', 'id' => 'desc'])
|
->order(['sort' => 'asc', 'created_at' => 'desc', 'id' => 'desc'])
|
||||||
->select();
|
->select();
|
||||||
if (!$products->isEmpty()) {
|
if (!$products->isEmpty()) {
|
||||||
// 获取sku信息
|
// 获取sku信息
|
||||||
|
|||||||
Reference in New Issue
Block a user