WIN-2308041133\Administrator před 2 měsíci
rodič
revize
7ed122979c

+ 2 - 2
app/api/controller/v1/user/UserBillController.php

@@ -74,7 +74,7 @@ class UserBillController
      * @param $type 0 全部  1 消费  2 充值  3 返佣  4 提现
      * @return mixed
      */
-    public function spread_commission(Request $request, $type)
+    public function spread_commission(Request $request, $type,$pm)
     {
         $uid = (int)$request->uid();
         $data = [];
@@ -90,7 +90,7 @@ class UserBillController
             case 4:
                 /** @var UserBrokerageServices $brokerageService */
                 $brokerageService = app()->make(UserBrokerageServices::class);
-                $data = $brokerageService->getBrokerageList($uid, $type);
+                $data = $brokerageService->getBrokerageList($uid, $type,$pm);
                 break;
         }
         return app('json')->success($data);

+ 17 - 14
app/services/user/UserBrokerageServices.php

@@ -402,7 +402,7 @@ class UserBrokerageServices extends BaseServices
      * @throws \think\db\exception\DbException
      * @throws \think\db\exception\ModelNotFoundException
      */
-    public function getBrokerageList($uid, $type)
+    public function getBrokerageList($uid, $type,$pm)
     {
         $where = [];
         $where['uid'] = $uid;
@@ -410,6 +410,9 @@ class UserBrokerageServices extends BaseServices
         if ($type == 4) {
             $where['type'] = ['extract', 'extract_money', 'extract_fail'];
         }
+        if ($pm !== '' && $pm !== null) {
+            $where['pm'] = $pm;
+        }
         /** @var UserExtractServices $userExtractService */
         $userExtractService = app()->make(UserExtractServices::class);
         $userExtract = $userExtractService->getColumn(['uid' => $uid], 'fail_msg,extract_type,state,wechat_order_id', 'id');
@@ -439,21 +442,21 @@ class UserBrokerageServices extends BaseServices
                 }
             }
 
-            // 生成月份列表
+//             生成月份列表
             $times = array_merge(array_unique(array_column($list, 'time_key')));
 
-            // type=3时按月份分组
-            if ($type == 3) {
-                $groupedList = [];
-                foreach ($list as $item) {
-                    $month = $item['time_key'];
-                    if (!isset($groupedList[$month])) {
-                        $groupedList[$month] = [];
-                    }
-                    $groupedList[$month][] = $item;
-                }
-                $list = $groupedList;
-            }
+//            // type=3时按月份分组
+//            if ($type == 3) {
+//                $groupedList = [];
+//                foreach ($list as $item) {
+//                    $month = $item['time_key'];
+//                    if (!isset($groupedList[$month])) {
+//                        $groupedList[$month] = [];
+//                    }
+//                    $groupedList[$month][] = $item;
+//                }
+//                $list = $groupedList;
+//            }
         }
         return ['list' => $list, 'time' => $times, 'count' => $count];
     }