Merge branch 'master' of https://git.shagain.club/shulang/webman
This commit is contained in:
commit
0cf7f6be1e
|
@ -44,7 +44,7 @@ class TaskController
|
|||
{
|
||||
$user_id = $request->data['id'];
|
||||
//挂机总时长 单位秒
|
||||
$res['time'] = UserDao::all_task_income($user_id) / 20 * 3600;
|
||||
$res['time'] = UserDao::Totalduration($user_id);
|
||||
//今天积分=0;
|
||||
$res['today_money'] = UserDao::today_task_income($user_id);
|
||||
//昨天积分
|
||||
|
|
|
@ -139,4 +139,16 @@ class UserDao
|
|||
Signlog::where('user_id',$user_id)->delete();
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
* 获取用户挂机总时长
|
||||
* 返回秒
|
||||
*/
|
||||
public static function Totalduration($user_id){
|
||||
$UserPhone=UserPhone::where('user_id',$user_id)->get();
|
||||
$time=0;
|
||||
foreach($UserPhone as $v){
|
||||
$time+=UserPhoneLog::where('phone',$v->phone)->sum('time');
|
||||
}
|
||||
return $time;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue