排序
This commit is contained in:
parent
9abac14802
commit
6cb8a607fe
@ -29,7 +29,7 @@ class SpuDao extends BaseDao
|
|||||||
{
|
{
|
||||||
$order = 'P.sort DESC';
|
$order = 'P.sort DESC';
|
||||||
if(isset($where['order'])){
|
if(isset($where['order'])){
|
||||||
if(in_array($where['order'], ['is_new', 'price_asc', 'price_desc', 'rate', 'sales'])){
|
if(in_array($where['order'], ['is_new', 'price_asc', 'price_desc', 'rate', 'sales','is_benefit'])){
|
||||||
if ($where['order'] == 'price_asc') {
|
if ($where['order'] == 'price_asc') {
|
||||||
$order = 'S.price ASC';
|
$order = 'S.price ASC';
|
||||||
} else if ($where['order'] == 'price_desc') {
|
} else if ($where['order'] == 'price_desc') {
|
||||||
|
@ -96,6 +96,8 @@ class MerchantDao extends BaseDao
|
|||||||
$query->when($order, function ($query) use ($where, $order) {
|
$query->when($order, function ($query) use ($where, $order) {
|
||||||
if ($order == 'rate') {
|
if ($order == 'rate') {
|
||||||
$query->order('is_best DESC, product_score DESC,service_score DESC,postage_score DESC');
|
$query->order('is_best DESC, product_score DESC,service_score DESC,postage_score DESC');
|
||||||
|
} else if ($order == 'sales'){
|
||||||
|
$query->order('sales DESC,is_best DESC,sort DESC');
|
||||||
}else if ($order == 'location' && isset($where['location']['long'], $where['location']['lat'])) {
|
}else if ($order == 'location' && isset($where['location']['long'], $where['location']['lat'])) {
|
||||||
$lng = (float)$where['location']['long'];
|
$lng = (float)$where['location']['long'];
|
||||||
$lat = (float)$where['location']['lat'];
|
$lat = (float)$where['location']['lat'];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user