diff --git a/application/adminapi/controller/SystemMessage.php b/application/adminapi/controller/SystemMessage.php index 612ba1a0..6ee570b6 100644 --- a/application/adminapi/controller/SystemMessage.php +++ b/application/adminapi/controller/SystemMessage.php @@ -78,7 +78,7 @@ class SystemMessage extends adminApi $data['title'] = $title; } - $content = input('content', ''); + $content = $_POST['content'] ?? ''; if($content){ $data['content'] = $content; } diff --git a/application/cron/controller/AppTodayStatistical.php b/application/cron/controller/AppTodayStatistical.php index f28d7ee1..3d63a269 100644 --- a/application/cron/controller/AppTodayStatistical.php +++ b/application/cron/controller/AppTodayStatistical.php @@ -30,6 +30,8 @@ class AppTodayStatistical public function daily_statistics(){ echo date('Y-m-d')."每日统计开始:\n"; $time = strtotime(date('Y-m-d')); + $stime = strtotime(date('Y-m-d')); + $etime = strtotime(date('Y-m-d 23:59:59')); $user_list = Db::name('user_wallet')->select(); foreach ($user_list as $k=>$v){ $gift_pack = Db::name('vs_user_gift_pack')->field('gid,num')->where(['user_id'=>$v['user_id'],'is_tester'=>1])->select(); @@ -39,39 +41,46 @@ class AppTodayStatistical } //用户房间今日总流水 //用户房间id - $room_id = db::name('vs_room')->where('user_id', $v['user_id'])->value('room_id'); + $room_id = db::name('vs_room')->where('user_id', $v['user_id'])->value('id'); $transaction = 0; if($room_id){ $transaction = db::name('vs_give_gift') ->where('from_id',$room_id) ->where('from',2) - ->whereTime('createtime', 'today') + ->whereBetween('createtime', [$stime, $etime]) ->sum('total_price'); } //公会流水 $guild_flow_price = 0; - $guild_id = db::name('vs_guild')->where(['user_id'=>$v['user_id'],'status'=>1,'delete_time'=>0])->value('guild_id'); + $guild_id = db::name('vs_guild')->where(['user_id'=>$v['user_id'],'status'=>1,'delete_time'=>0])->value('id'); if($guild_id){ $guild_flow_price= db::name('vs_guild_flow')->where('guild_id', $guild_id)->where('day', date('Y-m-d',$time))->sum('flow_price'); } //充值金额 - $recharge_price = db::name('vs_user_recharge')->where('pay_status',2)->whereTime('pay_time', 'today') + $recharge_price = db::name('vs_user_recharge') + ->where('user_id', $v['user_id']) + ->where('pay_status',2) + ->whereBetween('pay_time', [$stime, $etime]) ->sum('money'); //提现 - $withdraw_price = db::name('vs_user_withdrawal')->whereIn('status',[2,6])->whereTime('createtime', 'today')->sum('money'); + $withdraw_price = db::name('vs_user_withdrawal') + ->where('user_id', $v['user_id']) + ->whereIn('status',[2,6]) + ->whereBetween('createtime', [$stime, $etime]) + ->sum('money'); $data = [ - 'user_id'=>$v['user_id'], - 'coin'=>$v['coin'], - 'earnings'=>$v['earnings'], - 'gift_pack_price'=>$gift_pack_price, - 'room_flow_price'=>$transaction, - 'guild_flow_price'=>$guild_flow_price, - 'recharge_price'=>$recharge_price, - 'withdraw_price'=>$withdraw_price, + 'user_id'=>$v['user_id']??0, + 'coin'=>$v['coin']??0, + 'earnings'=>$v['earnings']??0, + 'gift_pack_price'=>$gift_pack_price??0, + 'room_flow_price'=>$transaction??0, + 'guild_flow_price'=>$guild_flow_price??0, + 'recharge_price'=>$recharge_price??0, + 'withdraw_price'=>$withdraw_price??0, 'day'=>date('Y-m-d',$time), 'createtime'=>$time, ]; - Db::name('app_today_statistical')->insert($data); + Db::name('vs_app_today_statistical')->insert($data); } echo date('Y-m-d')."每日统计结束 用户数量".count($user_list)." \n"; }