This commit is contained in:
mkm 2023-12-11 10:44:42 +08:00
parent df86becb41
commit a9fabbaa95

View File

@ -29,16 +29,12 @@ class SpuDao extends BaseDao
{
$order = 'P.sort DESC';
if(isset($where['order'])){
if(in_array($where['order'], ['is_new', 'price_asc', 'price_desc', 'rate', 'sales','procure_price_asc','procure_price_desc'])){
if(in_array($where['order'], ['is_new', 'price_asc', 'price_desc', 'rate', 'sales'])){
if ($where['order'] == 'price_asc') {
$order = 'S.price ASC';
} else if ($where['order'] == 'price_desc') {
$order = 'S.price DESC';
} else if ($where['order'] == 'procure_price_asc') {
$order = 'S.procure_price ASC';
} else if ($where['order'] == 'procure_price_desc') {
$order = 'S.procure_price DESC';
} else {
}else {
$order = 'P.'.$where['order'] . ' DESC';
}
}elseif($where['order'] == 'star'){