afa 7 tháng trước cách đây
mục cha
commit
9d2be3077f
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      application/common/model/ProductMarket.php

+ 4 - 1
application/common/model/ProductMarket.php

@@ -57,9 +57,12 @@ class ProductMarket extends Model
     //寄售
     public function producttransfer()
     {   
+        $map = [];
+        $transfer = input('post.transfer_id/d', 0);
+        if($transfer > 0) $map['id'] = $transfer;
         $order = 'price asc';
         if(input('post.sort') == 1) $order = 'price desc';
-        return $this->hasMany('ProductTransfer', 'product_id', 'product_id', [], 'LEFT')->order($order)->where('status', self::Normal);
+        return $this->hasMany('ProductTransfer', 'product_id', 'product_id', [], 'LEFT')->where($map)->where('status', self::Normal)->order($order);
     }