房间流水统计
This commit is contained in:
@@ -484,14 +484,11 @@ class Room extends Model
|
||||
public function room_turnover_detail($userId,$room_id,$stime,$etime,$page,$page_limit) {
|
||||
//查看用户和房间的关系
|
||||
$isOwner = 0;
|
||||
$isHost = 0;
|
||||
$owner = db::name('vs_room')->where(['id' => $room_id])->value('user_id');
|
||||
if($owner != $userId){
|
||||
$host = db::name('vs_room_host')->where(['room_id' => $room_id ,'user_id' => $userId,'type' => 1,'delete_time' => null])->find();
|
||||
if(!$host){
|
||||
return ['code' => 1, 'msg' => '成功', 'data' => ['total_amount' => 0, 'total_earning' => 0,'list' => null]];
|
||||
}else{
|
||||
$isHost = 1;
|
||||
}
|
||||
}else{
|
||||
$isOwner = 1;
|
||||
@@ -563,7 +560,7 @@ class Room extends Model
|
||||
}else{
|
||||
$total_earning = db::name('user_earnings_log')
|
||||
->where(['user_id' => $userId,'room_id' => $room_id,'change_type' => 19])
|
||||
->where('createtime', 'between', [strtotime($stime), strtotime($etime)])
|
||||
->where('createtime', 'between', [strtotime($stime), strtotime($etime.' 23:59:59')])
|
||||
->sum('earnings');
|
||||
}
|
||||
return ['code' => 1, 'msg' => '成功', 'data' => ['total_amount' => $total_amount, 'total_earning' => $total_earning,'list' => $list_data_array]];
|
||||
|
||||
Reference in New Issue
Block a user