WIN-2308041133\Administrator 8 months ago
parent
commit
28da410aa4
1 changed files with 11 additions and 2 deletions
  1. 11 2
      application/api/controller/Platform.php

+ 11 - 2
application/api/controller/Platform.php

@@ -38,11 +38,12 @@ class Platform extends Api
         $this->success('请求成功');
     }
 
-    public function user_share(){
+    public function user_share_order(){
         $map = []; // 初始化$map数组,避免未定义时的错误
         if(input('uid', 0) > 0){
             // 明确指定uid所属的表(假设主表为video_share)
             $map['video_share.uid'] = input('uid');
+            $count = $this->user_share_count($map['video_share.uid']);
         }
         $config = $this->config();
         $list = model('VideoShare')
@@ -51,9 +52,17 @@ class Platform extends Api
             ->limit(10)
             ->select();
 //        var_dump(model('VideoShare')->getLastSql());die();
-        $data = ['config' => $config, 'doctor' => $list];
+        $data = ['config' => $config, 'doctor' => $list,'count' => $count];
         $this->success('请求成功', $data);
     }
+    public function user_share_count($uid){
+        $map = []; // 初始化$map数组,避免未定义时的错误
+        $map['uid'] = $uid;
+        $count = model('VideoShare')
+            ->where($map)
+            ->count();
+        return $count;
+    }
 //    每个短剧更具贡献值分红
     public function dividend(){