|
@@ -17,6 +17,40 @@ class Userwallet extends Api
|
|
|
public function my_wallet(){
|
|
|
$wallet = model('wallet')->getwallet($this->auth->id);
|
|
|
$wallet['is_vip'] = $wallet['vip_endtime'] > time() ? 1 : 0;
|
|
|
+
|
|
|
+
|
|
|
+ //日报数据
|
|
|
+ $date = input('date',date('Y-m-d'));
|
|
|
+ $starttime = strtotime($date);
|
|
|
+ $endtime = $starttime + 86399;
|
|
|
+
|
|
|
+ //当日收益
|
|
|
+ $log_type = [];
|
|
|
+ Db::name('user_gold_log')
|
|
|
+ ->where('createtime','IN',[$starttime,$endtime])
|
|
|
+ ->where('user_id',$this->auth->id)
|
|
|
+ ->where('money_type','jewel')
|
|
|
+ ->where('log_type','IN',$log_type)
|
|
|
+ ->sum('change_value');
|
|
|
+
|
|
|
+ //通话时长
|
|
|
+ $where = [
|
|
|
+ 'to_user_id' => $this->auth->id,
|
|
|
+ 'createtime' => ['BETWEEN',[$starttime,$endtime]],
|
|
|
+ ];
|
|
|
+ $audio_log = Db::name('user_match_audio_log')->where($where)->select();
|
|
|
+ $audio_times = count($audio_log);//次数
|
|
|
+ $audio_call_minutes = array_sum(array_column($audio_log,'call_minutes'));//通话时长
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $video_log = Db::name('user_match_video_log')->where($where)->select();
|
|
|
+ $video_times = count($video_log);//次数
|
|
|
+ $video_call_minutes = array_sum(array_column($video_log,'call_minutes'));//通话时长
|
|
|
+
|
|
|
+ //平均通话(分钟)
|
|
|
+ //互动个人数
|
|
|
+
|
|
|
$this->success('success',$wallet);
|
|
|
}
|
|
|
|