|
@@ -156,13 +156,13 @@ class Agent extends Backend
|
|
|
$recharge_sum = Db::name('user_agentjewel_log')->where('user_id','IN',$downall_uid)->where('log_type',51)->where('createtime','BETWEEN',[$starttime,$endtime])->sum('change_value');
|
|
|
$result['recharge_sum'] = $recharge_sum;
|
|
|
//视频收益
|
|
|
- $video_sum = Db::name('user_match_video_log')->where('to_user_id','IN',$downall_uid)->where('updatetime','BETWEEN',[$starttime,$endtime])->sum('money');
|
|
|
+ $video_sum = Db::name('user_match_video_log')->where('to_user_id','IN',$downall_uid)->where('updatetime','BETWEEN',[$starttime,$endtime])->value('(sum(money) - sum(free_money))');
|
|
|
$result['video_sum'] = $video_sum;
|
|
|
//语音收益
|
|
|
- $audio_sum = Db::name('user_match_audio_log')->where('to_user_id','IN',$downall_uid)->where('updatetime','BETWEEN',[$starttime,$endtime])->sum('money');
|
|
|
+ $audio_sum = Db::name('user_match_audio_log')->where('to_user_id','IN',$downall_uid)->where('updatetime','BETWEEN',[$starttime,$endtime])->value('(sum(money) - sum(free_money))');
|
|
|
$result['audio_sum'] = $audio_sum;
|
|
|
//私信收益
|
|
|
- $typing_sum= Db::name('user_match_typing_log')->where('to_user_id','IN',$downall_uid)->where('createtime','BETWEEN',[$starttime,$endtime])->sum('money');
|
|
|
+ $typing_sum= Db::name('user_match_typing_log')->where('to_user_id','IN',$downall_uid)->where('createtime','BETWEEN',[$starttime,$endtime])->where('price != 0')->sum('money');
|
|
|
$result['typing_sum'] = $typing_sum;
|
|
|
//礼物收益
|
|
|
$gift_sum = Db::name('gift_user_typing')->where('user_to_id','IN',$downall_uid)->where('createtime','BETWEEN',[$starttime,$endtime])->sum('getvalue');
|
|
@@ -176,13 +176,13 @@ class Agent extends Backend
|
|
|
$a = Db::name('user_agentjewel_log')->where('user_id','IN',$downall_uid)->where('log_type',51)->where('createtime','BETWEEN',[$starttime,$endtime])->distinct(true)->field('user_id')->select();
|
|
|
$a1 = array_column($a,'user_id');
|
|
|
|
|
|
- $b = Db::name('user_match_video_log')->where('to_user_id','IN',$downall_uid)->where('updatetime','BETWEEN',[$starttime,$endtime])->distinct(true)->field('to_user_id')->select();
|
|
|
+ $b = Db::name('user_match_video_log')->where('to_user_id','IN',$downall_uid)->where('updatetime','BETWEEN',[$starttime,$endtime])->where('price != 0')->distinct(true)->field('to_user_id')->select();
|
|
|
$b1 = array_column($b,'to_user_id');
|
|
|
|
|
|
- $c = Db::name('user_match_audio_log')->where('to_user_id','IN',$downall_uid)->where('updatetime','BETWEEN',[$starttime,$endtime])->distinct(true)->field('to_user_id')->select();
|
|
|
+ $c = Db::name('user_match_audio_log')->where('to_user_id','IN',$downall_uid)->where('updatetime','BETWEEN',[$starttime,$endtime])->where('price != 0')->distinct(true)->field('to_user_id')->select();
|
|
|
$c1 = array_column($c,'to_user_id');
|
|
|
|
|
|
- $d = Db::name('user_match_typing_log')->where('to_user_id','IN',$downall_uid)->where('createtime','BETWEEN',[$starttime,$endtime])->distinct(true)->field('to_user_id')->select();
|
|
|
+ $d = Db::name('user_match_typing_log')->where('to_user_id','IN',$downall_uid)->where('createtime','BETWEEN',[$starttime,$endtime])->where('price != 0')->distinct(true)->field('to_user_id')->select();
|
|
|
$d1 = array_column($d,'to_user_id');
|
|
|
|
|
|
$e = Db::name('gift_user_typing')->where('user_to_id','IN',$downall_uid)->where('createtime','BETWEEN',[$starttime,$endtime])->distinct(true)->field('user_to_id')->select();
|
|
@@ -279,13 +279,13 @@ class Agent extends Backend
|
|
|
$recharge_sum = Db::name('user_agentjewel_log')->where('user_id',$user['id'])->where('log_type',51)->sum('change_value');
|
|
|
$user['recharge_sum'] = $recharge_sum;
|
|
|
//视频收益
|
|
|
- $video_sum = Db::name('user_match_video_log')->where('to_user_id',$user['id'])->sum('money');
|
|
|
+ $video_sum = Db::name('user_match_video_log')->where('to_user_id',$user['id'])->value('(sum(money) - sum(free_money))');
|
|
|
$user['video_sum'] = $video_sum;
|
|
|
//语音收益
|
|
|
- $audio_sum = Db::name('user_match_audio_log')->where('to_user_id',$user['id'])->sum('money');
|
|
|
+ $audio_sum = Db::name('user_match_audio_log')->where('to_user_id',$user['id'])->value('(sum(money) - sum(free_money))');
|
|
|
$user['audio_sum'] = $audio_sum;
|
|
|
//私信收益
|
|
|
- $typing_sum= Db::name('user_match_typing_log')->where('to_user_id',$user['id'])->sum('money');
|
|
|
+ $typing_sum= Db::name('user_match_typing_log')->where('to_user_id',$user['id'])->where('price != 0')->sum('money');
|
|
|
$user['typing_sum'] = $typing_sum;
|
|
|
//礼物收益
|
|
|
$gift_sum = Db::name('gift_user_typing')->where('user_to_id',$user['id'])->sum('getvalue');
|
|
@@ -356,13 +356,13 @@ class Agent extends Backend
|
|
|
$recharge_sum = Db::name('user_agentjewel_log')->where('user_id',$user['id'])->where('log_type',51)->where('createtime','BETWEEN',[$starttime,$endtime])->sum('change_value');
|
|
|
// $user['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');
|
|
|
+ $video_sum = Db::name('user_match_video_log')->where('to_user_id',$user['id'])->where('updatetime','BETWEEN',[$starttime,$endtime])->value('(sum(money) - sum(free_money))');
|
|
|
// $user['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');
|
|
|
+ $audio_sum = Db::name('user_match_audio_log')->where('to_user_id',$user['id'])->where('updatetime','BETWEEN',[$starttime,$endtime])->value('(sum(money) - sum(free_money))');
|
|
|
// $user['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');
|
|
|
+ $typing_sum= Db::name('user_match_typing_log')->where('to_user_id',$user['id'])->where('createtime','BETWEEN',[$starttime,$endtime])->where('price != 0')->sum('money');
|
|
|
// $user['typing_sum'] = $typing_sum;
|
|
|
//礼物收益
|
|
|
$gift_sum = Db::name('gift_user_typing')->where('user_to_id',$user['id'])->where('createtime','BETWEEN',[$starttime,$endtime])->sum('getvalue');
|
|
@@ -390,13 +390,13 @@ class Agent extends Backend
|
|
|
$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');
|
|
|
+ $video_sum = Db::name('user_match_video_log')->where('to_user_id',$user_id)->value('(sum(money) - sum(free_money))');
|
|
|
$user_info['video_sum'] = $video_sum;
|
|
|
//语音收益
|
|
|
- $audio_sum = Db::name('user_match_audio_log')->where('to_user_id',$user_id)->sum('money');
|
|
|
+ $audio_sum = Db::name('user_match_audio_log')->where('to_user_id',$user_id)->value('(sum(money) - sum(free_money))');
|
|
|
$user_info['audio_sum'] = $audio_sum;
|
|
|
//私信收益
|
|
|
- $typing_sum= Db::name('user_match_typing_log')->where('to_user_id',$user_id)->sum('money');
|
|
|
+ $typing_sum= Db::name('user_match_typing_log')->where('to_user_id',$user_id)->where('price != 0')->sum('money');
|
|
|
$user_info['typing_sum'] = $typing_sum;
|
|
|
//礼物收益
|
|
|
$gift_sum = Db::name('gift_user_typing')->where('user_to_id',$user_id)->sum('getvalue');
|
|
@@ -475,13 +475,13 @@ class Agent extends Backend
|
|
|
$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');
|
|
|
+ $video_sum = Db::name('user_match_video_log')->where('to_user_id',$user_id)->where('updatetime','BETWEEN',[$starttime,$endtime])->value('(sum(money) - sum(free_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');
|
|
|
+ $audio_sum = Db::name('user_match_audio_log')->where('to_user_id',$user_id)->where('updatetime','BETWEEN',[$starttime,$endtime])->value('(sum(money) - sum(free_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');
|
|
|
+ $typing_sum= Db::name('user_match_typing_log')->where('to_user_id',$user_id)->where('createtime','BETWEEN',[$starttime,$endtime])->where('price != 0')->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');
|