Browse Source

邀请中心接口,成员详情

lizhen_gitee 11 months ago
parent
commit
1a5b998dab
1 changed files with 72 additions and 0 deletions
  1. 72 0
      application/api/controller/Userintro.php

+ 72 - 0
application/api/controller/Userintro.php

@@ -324,6 +324,78 @@ class Userintro extends Api
     }
 
     //成员详情
+    public function user_info(){
+        $user_id = input('user_id',0);
+
+        $user_info = Db::name('user')->where('id',$user_id)->field('id,username,avatar,nickname,intro_uid,yaoqingtime')->find();
+
+        //邀请奖励收益
+        $recharge_sum = Db::name('user_agentjewel_log')->where('user_id',$user_id)->where('log_type',51)->sum('change_value');
+        $user_info['recharge_sum'] = $recharge_sum;
+        //视频收益
+        $video_sum = Db::name('user_match_video_log')->where('to_user_id',$user_id)->sum('money');
+        $user_info['video_sum'] = $video_sum;
+        //语音收益
+        $audio_sum = Db::name('user_match_audio_log')->where('to_user_id',$user_id)->sum('money');
+        $user_info['audio_sum'] = $audio_sum;
+        //私信收益
+        $typing_sum= Db::name('user_match_typing_log')->where('to_user_id',$user_id)->sum('money');
+        $user_info['typing_sum'] = $typing_sum;
+        //礼物收益
+        $gift_sum  = Db::name('gift_user_typing')->where('user_to_id',$user_id)->sum('getvalue');
+        $user_info['gift_sum'] = $gift_sum;
+        //总收益
+        $user_info['total'] = $recharge_sum + $video_sum + $audio_sum + $typing_sum + $gift_sum;
+
+        $this->success(1,$user_info);
+    }
+
+    //成员详情-日历数据
+    public function user_info_date(){
+        $user_id = input('user_id',0);
+
+        //日期
+        $todaytime = strtotime(date('Y-m-d'));//今天凌晨
+
+        $datelist = [];
+        for($i=0;$i<$this->listrow;$i++){ //循环10次
+
+            $day = ($this->page-1)*$this->listrow + $i;//往前推的天数
+
+            $starttime = $todaytime - $day*86400;
+            $endtime   = $starttime + 86399;
+
+            $thisday = [
+                'date' => date('m-d',$starttime),
+            ];
+
+            //邀请奖励收益
+            $recharge_sum = Db::name('user_agentjewel_log')->where('user_id',$user_id)->where('log_type',51)->where('createtime','BETWEEN',[$starttime,$endtime])->sum('change_value');
+            $thisday['recharge_sum'] = $recharge_sum;
+            //视频收益
+            $video_sum = Db::name('user_match_video_log')->where('to_user_id',$user_id)->where('updatetime','BETWEEN',[$starttime,$endtime])->sum('money');
+            $thisday['video_sum'] = $video_sum;
+            //语音收益
+            $audio_sum = Db::name('user_match_audio_log')->where('to_user_id',$user_id)->where('updatetime','BETWEEN',[$starttime,$endtime])->sum('money');
+            $thisday['audio_sum'] = $audio_sum;
+            //私信收益
+            $typing_sum= Db::name('user_match_typing_log')->where('to_user_id',$user_id)->where('createtime','BETWEEN',[$starttime,$endtime])->sum('money');
+            $thisday['typing_sum'] = $typing_sum;
+            //礼物收益
+            $gift_sum  = Db::name('gift_user_typing')->where('user_to_id',$user_id)->where('createtime','BETWEEN',[$starttime,$endtime])->sum('getvalue');
+            $thisday['gift_sum'] = $gift_sum;
+            //总收益
+            $thisday['total'] = $recharge_sum + $video_sum + $audio_sum + $typing_sum + $gift_sum;
+
+            //
+            $datelist[] = $thisday;
+        }
+
+        $this->success(1,$datelist);
+
+    }
+
+
     //邀请页