酒吧房:->相关接口提交-bug修改

This commit is contained in:
2026-01-06 14:41:42 +08:00
parent 41f10bc387
commit fcf19e80a4
4 changed files with 99 additions and 64 deletions

View File

@@ -28,8 +28,10 @@ class Test
// $this->clean_guild_flow();
// $this->giftSend();
// $this->createGuildSubsidyDataNewNew();
// $this->task_coin_count();
// $this->createGuildSubsidyDataNewNew();
// $this->task_coin_count();
$this->createGuildSubsidyDataNew();
// $this->repair_guild_room_data();
}
@@ -722,6 +724,7 @@ class Test
$guild_user_data = db::name('vs_guild_user')->where('guild_id', $value['id'])->where(['apply_time'=>['>',0],'status'=>1,'room_id'=>['>',0]])->field('room_id,apply_time,quit_time')->select();
$transaction = 0;
foreach ($guild_user_data as $k => $v) {
$week_start_time_seach = $week_start_time;
$week_end_time_seach = $week_end_time;
if($v['apply_time'] && $week_end_time_seach < $v['apply_time']){
@@ -745,9 +748,9 @@ class Test
if($transaction > 0){
//判断是否已经生成过
if (db::name('vs_guild_subsidy')->where(['guild_id'=>$value['id'],'week'=>$time_value])->find()) {
continue;
}
// if (db::name('vs_guild_subsidy')->where(['guild_id'=>$value['id'],'week'=>$time_value])->find()) {
// continue;
// }
//获取补贴配置
$config = db::name('vs_guild_subsidy_config')->where(['status' => 1])->order('end_amount desc')->select(); //配置查询
if (!$config) {
@@ -799,8 +802,8 @@ class Test
// $week_start_time = strtotime('2025-12-08');
// $week_end_time = strtotime('2025-12-15');
$week_start_time = strtotime('2025-12-22');
$week_end_time = strtotime('2025-12-31');
// $week_start_time = strtotime('2025-12-22');
// $week_end_time = strtotime('2025-12-31');
//获取上周时间
$time_value = date('o-W', $week_start_time);
@@ -927,42 +930,42 @@ class Test
$old_nobility_info = db::name('vs_nobility')
->field('lid,name,pay_price,pay_coin')
->where('delete_time', 0)
->where('lid',7)
->find();
$nobility_info = db::name('vs_nobility')
->field('lid,name,image,pay_price,renew_price,day,power_ids')
->where('delete_time', 0)
->where('lid', 8)
->find();
$old_end_time = 1774848342;
$pay_time = 1767278104;
$surplus_time = $old_end_time - $pay_time;
$old_nobility_info = db::name('vs_nobility')
->field('lid,name,pay_price,pay_coin')
->where('delete_time', 0)
->where('lid',7)
->find();
$nobility_info = db::name('vs_nobility')
->field('lid,name,image,pay_price,renew_price,day,power_ids')
->where('delete_time', 0)
->where('lid', 8)
->find();
$old_end_time = 1774848342;
$pay_time = 1767278104;
$surplus_time = $old_end_time - $pay_time;
// echo $surplus_time;
if($surplus_time > 0){
//小时
$surplus_time_hour = floor($surplus_time / 3600); //向下取整
if($surplus_time > 0){
//小时
$surplus_time_hour = floor($surplus_time / 3600); //向下取整
// echo $surplus_time_hour;die;
// echo ($old_nobility_info['pay_price'] / $nobility_info['day']) / 24;die;
$price = $nobility_info['pay_price'] - bcmul($surplus_time_hour * (($old_nobility_info['pay_price'] / $nobility_info['day']) / 24),1,2);
$price = $nobility_info['pay_price'] - bcmul($surplus_time_hour * (($old_nobility_info['pay_price'] / $nobility_info['day']) / 24),1,2);
//使用时间
$use_time = $old_nobility_info['1767072342'] - time();
$price = $nobility_info['pay_price'] - $old_nobility_info['pay_price'] + ((($old_nobility_info['pay_price'] / $nobility_info['day']) / 24) * $use_time);
//价格=
//一小时的价格算
//使用时间
$use_time = $old_nobility_info['1767072342'] - time();
$price = $nobility_info['pay_price'] - $old_nobility_info['pay_price'] + ((($old_nobility_info['pay_price'] / $nobility_info['day']) / 24) * $use_time);
//价格=
//一小时的价格算
}
}
// $end_time = time() + $nobility_info['day'] * 86400;
echo $price;
echo $price;
// }
// $re = model('api/Decorate')->pay_decorate(20150,46,30,9);
// $re = model('api/Decorate')->pay_decorate(20150,46,30,9);
// print_r($re);die;
}
@@ -971,10 +974,17 @@ class Test
// $etime = "2025-12-29 10:30:00";
// $stime = "2025-12-29 00:00:00";
// $etime = "2025-12-30 04:00:00";
$stime = "2025-12-29 00:00:00";
$etime = "2026-01-05 00:00:00";
// $stime = "2025-12-29 00:00:00";
// $etime = "2026-01-05 00:00:00";
// $stime = "2025-12-22 00:00:00";
// $etime = "2025-12-29 00:00:00";
// $stime = "2025-12-29 00:00:00";
// $etime = "2025-12-31 01:14:09";
$stime = "2025-12-31 01:14:09";
$etime = "2026-01-05 00:00:00";
//获取所有已领取的任务奖励礼包
$where = [];
if(!empty($stime)){
@@ -986,25 +996,25 @@ class Test
if(!empty($stime) && !empty($etime)){
$where['a.createtime'] = ['between', [strtotime($stime), strtotime($etime)]];
}
if(!empty($etime) && strtotime($etime)<="1767038400"){//2025-12-30 04:00:00
$tasks_bag_details = db::name('vs_gift_bag_receive_log')
->alias('a')
->join('vs_gift_bag_detail b', 'a.parent_id=b.id')
->field('a.createtime,b.type,b.foreign_id,b.quantity,b.gold')
->where(['b.type'=>['in', [1,2]]])
->whereBetween('a.gift_bag_id', [18, 51])
->where($where)
->select();
}else{
$tasks_bag_details = db::name('vs_gift_bag_receive_tasks_log')
->alias('a')
->join('vs_gift_bag_detail b', 'a.parent_id=b.id')
->field('a.createtime,b.type,b.foreign_id,b.quantity,b.gold')
->where(['b.type'=>['in', [1,2]]])
->whereBetween('a.gift_bag_id', [18, 51])
->where($where)
->select();
}
// if(!empty($etime) && strtotime($etime)<="1767038400"){//2025-12-30 04:00:00
// $tasks_bag_details = db::name('vs_gift_bag_receive_log')
// ->alias('a')
// ->join('vs_gift_bag_detail b', 'a.parent_id=b.id')
// ->field('a.createtime,b.type,b.foreign_id,b.quantity,b.gold')
// ->where(['b.type'=>['in', [1,2]]])
// ->whereBetween('a.gift_bag_id', [18, 51])
// ->where($where)
// ->select();
// }else{
$tasks_bag_details = db::name('vs_gift_bag_receive_tasks_log')
->alias('a')
->join('vs_gift_bag_detail b', 'a.parent_id=b.id')
->field('a.createtime,b.type,b.foreign_id,b.quantity,b.gold')
->where(['b.type'=>['in', [1,2]]])
->whereBetween('a.gift_bag_id', [18, 51])
->where($where)
->select();
// }
$total_reward_price = 0;
foreach ($tasks_bag_details as $detail){
if($detail['type'] == 1){
@@ -1016,4 +1026,29 @@ class Test
}
echo $total_reward_price;
}
//修复公会房间数据
public function repair_guild_room_data(){
$guild_user_data = db::name('vs_guild_user')->where(['apply_time'=>['>',0],'status'=>1,'room_id'=>['>',0]])->field('id,user_id,room_id,guild_id,apply_time,quit_time')->select();
$num = 0;
foreach ($guild_user_data as $k => $v) {
$room_info = db::name('vs_room')->where('id',$v['room_id'])->field('id,type_id')->find();
if($room_info['type_id'] == 6){
$troom_info = db::name('vs_room')->where(['user_id'=>$v['user_id'],'delete_time'=>0,'type_id'=>['<>',6]])->find();
$rid =0;
if($troom_info){
$rid = $troom_info['id']??0;
}
$guild_name = db::name('vs_guild')->where('id',$v['guild_id'])->value('guild_name');
echo "公会名称:".$guild_name." 公会Id".$v['guild_id']." 关系Id".$v['id']."错误房间Id".$v['room_id']."正确房间Id".$rid."\n";
// $re = db::name('vs_guild_user')->where('id',$v['id'])->update(['room_id'=>$rid]);
// if($re){
// $num++;
// }
}
}
echo "修改完成 共:".$num;
}
}