作者 王晓刚

商品搜索

... ... @@ -202,7 +202,7 @@ class Goods extends Frontend
if(!empty($param['store_id'])){
$where['g.store_id'] = ['eq',$param['store_id']];
}
$order = 'distance asc';//'g.weigh desc';
$order = 'g.weigh desc';
if(!empty($param['sort'])){
if($param['sort'] == 1){
//销量降序
... ... @@ -236,6 +236,7 @@ class Goods extends Frontend
$goodsModel = new \app\index\model\Goods();
$ids = [];
if(!empty($param['lng']) && !empty($param['lat'])){
$order = 'g.weigh desc';
$data = $goodsModel
->alias('g')
->field([
... ...