yingzi 1 year ago
parent
commit
91fd5180f9

+ 11 - 0
Controller/NewCommission/ApiNewCommissionPartner.Class.php

@@ -57,6 +57,17 @@ class ApiNewCommissionPartner extends BaseController
         $pageParams = pageToOffset($params['page'] ?: 1, $params['pageSize'] ?: 10);
         $selectParams['limit'] = $pageParams['limit'];
         $selectParams['offset'] = $pageParams['offset'];
+        $where=[];
+        if(!empty($params['code']) && in_array($params['code'], ["consume","income"])){
+            if($params['code']=="consume"){
+                $where["type"] = 0;
+            }
+            if($params['code']=="income"){
+                $where["type"] = 1;
+            }
+        }
+        $selectParams["where"] = $where;
+        
         $data = $this->partnerTool->getCommissionDetail($this->customerData["id"],$selectParams);
         parent::sendOutput($data);
     }

+ 4 - 0
Util/Common/PartnerTools.Class.php

@@ -548,9 +548,13 @@ class PartnerTools{
      */
     public function getCommissionDetail($customerId,$parms){
         $where=[];
+        if(!empty($parms["where"])){
+            $where= $parms["where"];
+        }
         if(!empty($customerId)){
             $where["customerId"] = $customerId;
         }
+        
         $data = $this->dbNewCommissionDetail->select(["customerId"=>$customerId], "*", "id desc", $parms["limit"], $parms["offset"]);
         $total = $this->dbNewCommissionDetail->count($where);
         if(empty($data)){