房间流水统计

This commit is contained in:
2026-01-09 15:08:30 +08:00
parent 5bc428b5f1
commit 42785f219f

View File

@@ -559,10 +559,10 @@ class Room extends Model
if($isOwner) {
$total_earning = round($total_amount * $room_user_ratio / $coin_exchange_rate, 4);
}else{
$total_earning = db::name('user_earnings_log')
$total_earning = rand(db::name('user_earnings_log')
->where(['user_id' => $userId,'room_id' => $room_id,'change_type' => 19])
->where(['createtime' => ['between', [strtotime($stime), $end_time]]])
->sum('earnings');
->sum('earnings'),4);
}
return ['code' => 1, 'msg' => '成功', 'data' => ['total_amount' => $total_amount, 'total_earning' => $total_earning,'list' => $list_data_array]];
}