diff --git a/app/api/controller/purchase_product_offer/PurchaseProductOfferController.php b/app/api/controller/purchase_product_offer/PurchaseProductOfferController.php index ff5b04181..658a806f7 100644 --- a/app/api/controller/purchase_product_offer/PurchaseProductOfferController.php +++ b/app/api/controller/purchase_product_offer/PurchaseProductOfferController.php @@ -26,7 +26,6 @@ class PurchaseProductOfferController extends BaseApiController */ public function lists() { - $this->request->__set('uid',$this->userId); return $this->dataLists(new PurchaseProductOfferLists()); } diff --git a/app/api/lists/purchase_product_offer/PurchaseProductOfferLists.php b/app/api/lists/purchase_product_offer/PurchaseProductOfferLists.php index 73ef2ef1d..1edf7275f 100644 --- a/app/api/lists/purchase_product_offer/PurchaseProductOfferLists.php +++ b/app/api/lists/purchase_product_offer/PurchaseProductOfferLists.php @@ -18,7 +18,6 @@ use app\api\lists\BaseApiDataLists; class PurchaseProductOfferLists extends BaseApiDataLists implements ListsSearchInterface { - public $userId; /** * @notes 设置搜索条件 * @return \string[][] @@ -44,9 +43,8 @@ class PurchaseProductOfferLists extends BaseApiDataLists implements ListsSearchI */ public function lists(): array { - $uid=$this->request->__get('uid'); - if($uid){ - $this->searchWhere[]=['buyer_id','=',$uid]; + if($this->userId>0){ + $this->searchWhere[]=['buyer_id','=',$this->userId]; }else{ return []; } @@ -87,10 +85,10 @@ class PurchaseProductOfferLists extends BaseApiDataLists implements ListsSearchI */ public function count(): int { - if($this->userId){ - return 0; - }else{ + if($this->userId>0){ return PurchaseProductOffer::where($this->searchWhere)->count(); + }else{ + return 0; } }