Browse Source

寄售转让列表

afa 6 months ago
parent
commit
50303e0ba0
1 changed files with 7 additions and 5 deletions
  1. 7 5
      application/api/controller/Product.php

+ 7 - 5
application/api/controller/Product.php

@@ -56,6 +56,7 @@ class Product extends Api
 
 
 
+
     /**
      * 寄售转让列表
      * sort: 0 默认排序 1价格从高到低 2价格从低到高
@@ -67,8 +68,9 @@ class Product extends Api
         $sort    = $this->request->post('sort/d', '');
         $type_id = $this->request->post('type_id/s', '');
         $key_val = $this->request->post('key_val/s', '');
-        $order = 'b.weigh ASC';
-        if($sort == 1) $order = 'b.weigh desc';
+        $order = 'b.weigh desc';
+        if($sort == 1) $order = 'price desc, a.product_id DESC';
+        if($sort == 2) $order = 'price ASC, a.product_id ASC';
         $map['a.status'] = $productTransfer::Normal;
         if(!empty($type_id)) $map['b.type_id'] = $type_id;
         if(!empty($key_val)) $map['b.'.$this->lan.'_name'] = ['like', '%'.$key_val.'%'];
@@ -98,9 +100,9 @@ class Product extends Api
         $sort    = $this->request->post('sort/d', '');
         $type_id = $this->request->post('type_id/s', '');
         $key_val = $this->request->post('key_val/s', '');
-        $order = 'b.weigh ASC';
-        if($sort == 1) $order = 'b.weigh DESC';
-        //if($sort == 2) $order = 'price ASC';
+        $order = 'b.weigh desc';
+        if($sort == 1) $order = 'price DESC, a.product_id DESC';
+        if($sort == 2) $order = 'price ASC, a.product_id ASC';
         $map['a.status'] = $productTransfer::Normal;
         if(!empty($type_id)) $map['b.type_id'] = $type_id;
         if(!empty($key_val)) $map['b.'.$this->lan.'_name'] = ['like', '%'.$key_val.'%'];