WIN-2308041133\Administrator 8 months ago
parent
commit
73acf110d3
1 changed files with 16 additions and 3 deletions
  1. 16 3
      application/api/controller/Platform.php

+ 16 - 3
application/api/controller/Platform.php

@@ -73,14 +73,27 @@ class Platform extends Api
 //    查看各平台的收益情况
     public function platform_income(){
         $map = []; // 初始化$map数组,避免未定义时的错误
-        if(input('uid', 0) > 0){
+        if(input('platform_id', 0) > 0){
             // 明确指定uid所属的表(假设主表为video_share)
-            $map['video_share.uid'] = input('uid');
+            $map['video_platform_record.platform_id'] = input('uid');
         }
         if(input('vid', 0) > 0){
             // 明确指定uid所属的表(假设主表为video_share)
-            $map['video_share.vid'] = input('vid');
+            $map['video_platform_record.vid'] = input('vid');
         }
+        list($where, $sort, $order, $offset, $limit) = $this->buildparams();
+        $config = $this->config();
+        $list = model('VideoPlatformRecord')
+            ->with('platform,video')
+            ->where($map)
+            ->limit($offset, $limit)
+            ->select();
+        $total = model('VideoPlatformRecord')
+            ->with('platform,video')
+            ->where($map)
+            ->count();
+        $data = ['config' => $config, 'doctor' => $list,'total'=>$total];
+        $this->success('请求成功', $data);
 
     }
 //  每日分配各个短剧在不同平台的收益