This commit is contained in:
aozhiwei 2020-12-22 17:38:08 +08:00
parent 798cd5ad93
commit eb9810aa77
4 changed files with 15 additions and 9 deletions

View File

@ -106,13 +106,13 @@ CREATE TABLE `user` (
`passcard` int(11) NOT NULL DEFAULT '0' COMMENT '购买进阶手册状态',
`rmb_lot_ticket` int(11) NOT NULL DEFAULT '0' COMMENT '充值券数量',
`daily_max_single` int(11) NOT NULL DEFAULT '0' COMMENT '每日最大单次充值数量',
`free_lot_ticket` int(11) NOT NULL DEFAULT '0' COMMENT '免费抽奖券',
`head_kuang_id` int(11) NOT NULL DEFAULT '0' COMMENT '头像框id',
`daily_score` int(11) NOT NULL DEFAULT '0' COMMENT '每日经验',
`daily_offline` int(11) NOT NULL DEFAULT '0' COMMENT '每日额外离线奖励次数',
`create_user` int(11) NOT NULL DEFAULT '0' COMMENT '是否创角',
`sex` int(11) NOT NULL DEFAULT '0' COMMENT '性别',
`sumlot_coin` double NOT NULL DEFAULT '0' COMMENT '累计抽奖剩余金额',
PRIMARY KEY (`idx`),
UNIQUE KEY `accountid` (`accountid`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

View File

@ -1,5 +1,7 @@
<?php
require 'phpcommon/test_hook.php';
class OpsController {
private $gameid = 1009;
@ -11,6 +13,7 @@ class OpsController {
'errmsg' => "gameid:{$this->gameid}",
'healthy' => 1,
'max_rundelay' => 1,
'time' => time()
));
}

View File

@ -129,7 +129,7 @@ class PayActivityController{
$addreward = new classes\AddReward();
$now_lv = $addreward->getVipLevel($account_id);
$this->recSingleRmb($num, $account_id);
$this->addRmb($num, $account_id);
$locket = $this->addRmb($num, $account_id);
$quest = new classes\Quest();
$quest->flushActQuest(71014, $num, $account_id);
$new_lv = $addreward->getVipLevel($account_id);
@ -144,18 +144,20 @@ class PayActivityController{
'errmsg' => '',
'isUp' => $isUp,
'lv' => $new_lv,
'locket' => $locket,
));
}
protected function addRmb($num, $account_id)
{
$conn = $this->getMysql($account_id);
$row = $conn->execQueryOne('SELECT accountid, sum_coin, recharge_times_total, max_single_recharge, daily_max_single, rmb_lot_ticket FROM user WHERE accountid=:accountid;',
$row = $conn->execQueryOne('SELECT accountid, sum_coin, recharge_times_total, max_single_recharge, daily_max_single, rmb_lot_ticket, sumlot_coin FROM user WHERE accountid=:accountid;',
array(
':accountid' => $account_id
));
$sum_coin = $row['sum_coin'] + $num;
$rmb_lot_ticket = floor($num / 10) + $row['rmb_lot_ticket'];
$rmb_lot_ticket = floor(($num + $row['sumlot_coin']) / 10) + $row['rmb_lot_ticket'];
$sumlot_coin = floor(($num + $row['sumlot_coin']) % 10);
$recharge_times_total = $row['recharge_times_total'] + 1;
$max_single_recharge = $row['max_single_recharge'];
if ($max_single_recharge < $num) {
@ -165,7 +167,7 @@ class PayActivityController{
if ($daily_max_single < $num) {
$daily_max_single = $num;
}
$ret = $conn->execScript('UPDATE user SET sum_coin=:sum_coin, recharge_times_total=:recharge_times_total, max_single_recharge=:max_single_recharge, daily_max_single=:daily_max_single, modify_time=:modify_time, rmb_lot_ticket=:rmb_lot_ticket WHERE accountid=:accountid;',
$ret = $conn->execScript('UPDATE user SET sum_coin=:sum_coin, recharge_times_total=:recharge_times_total, max_single_recharge=:max_single_recharge, daily_max_single=:daily_max_single, modify_time=:modify_time, rmb_lot_ticket=:rmb_lot_ticket, sumlot_coin=:sumlot_coin WHERE accountid=:accountid;',
array(
':accountid' => $account_id,
':modify_time' => time(),
@ -174,7 +176,9 @@ class PayActivityController{
':max_single_recharge' => $max_single_recharge,
':daily_max_single' => $daily_max_single,
':rmb_lot_ticket' => $rmb_lot_ticket,
':sumlot_coin' => $sumlot_coin,
));
return $rmb_lot_ticket;
}
public function rechargeBuy()
@ -609,7 +613,6 @@ class PayActivityController{
return;
}
$item_list = array();
error_log($item_conf);
for ($i = 0; $i < $num; $i++) {
$items = metatable\getDropListById($item_conf['fuctionindex']);
if (!$items) {

View File

@ -201,9 +201,9 @@ class RoleController{
break;
}
}
$ret = $conn->execScript('INSERT INTO user(accountid, user_name, avatar_url, game_times, win_times, kills, harm, add_HP, alive_time, coin_num, integral, kill_his, alive_time_his, harm_his, add_HP_his, act_share_time, act_share_status, create_time, modify_time, first_fight, collect_status, keys_num, battle_re_times, shop_flush_times, kefu_status, sign_sum, box_num, diamond_num, sum_coin, pass_status, score, season_status, recharge_times_total, first_gift, season_time, free_coin, free_diamond, season_end_score, kill_modifytime, win_modifytime, rank_modifytime, vip_score, first_login, daily_first_login, daily_time, free_box, update_time, season_games, season_win, sea_max_kill, sea_max_hart, sea_avg_kill, free_lot_ticket, free_dou_lot_ticket, daily_order1, daily_order2, daily_order3, first_bee, newhand, coin_times, newInfo, first_day_ad, share_video_times, share_video_sums, act_video_status, act_ad_status, biogame_times, shop_view_times, new_first_equip, newhand2,game_times2, view_times2, guildcoin_num, new_second_equip, rmb_num, max_single_recharge, passcard, rmb_lot_ticket, daily_max_single, head_kuang_id, daily_score, daily_offline, create_user, sex) ' .
' VALUES(:accountid, :user_name, :avatar_url, 0, 0, 0, 0, 0, 0, 10000, 0, 0, 0, 0, 0, 0, 0, :create_time, :modify_time, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, :season_time, 0, 0, 0, 0, 0, 0, 0, 0, 0, :daily_time, 0,:update_time,0,0,0,0,0,0,0,0,0,0,0,0,0,:newInfo,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, 0, 0, 0, 0, 0, 0, 2) ' .
' ON DUPLICATE KEY UPDATE accountid=:accountid, user_name=:user_name, avatar_url=:avatar_url, game_times=0, win_times=0, kills=0, harm=0, add_HP=0, alive_time=0, coin_num=0, integral=0, kill_his=0, alive_time_his=0, harm_his=0, add_HP_his=0, act_share_time=0, act_share_status=0, modify_time=:modify_time, first_fight=0, collect_status=0, keys_num=0, battle_re_times=0, shop_flush_times=0, kefu_status=0, sign_sum=0, box_num=0, diamond_num=0, sum_coin=0, pass_status=0, score=0, season_status=1, recharge_times_total=0, first_gift=0, season_time=:season_time, free_coin=0, free_diamond=0, season_end_score=0, kill_modifytime=0, win_modifytime=0, rank_modifytime=0, vip_score=0, first_login=0, daily_first_login=0, daily_time=:daily_time, free_box=0, update_time=:update_time, season_games=0, season_win=0, sea_max_kill=0, sea_max_hart=0, sea_avg_kill=0, free_lot_ticket=0, free_dou_lot_ticket=0, daily_order1=0, daily_order2=0, daily_order3=0, first_bee=0, newhand=0, coin_times=0, newInfo=:newInfo, first_day_ad=0, share_video_times=0, share_video_sums=0, act_video_status=0, act_ad_status=0, biogame_times=0, shop_view_times=0, new_first_equip=0, newhand2=0, game_times2=0,view_times2=0, guildcoin_num=0, new_second_equip=2, rmb_num=0, max_single_recharge=0, passcard=0, rmb_lot_ticket=0, daily_max_single=0, head_kuang_id=0, daily_score=0, daily_offline=0, create_user=0, sex=2;',
$ret = $conn->execScript('INSERT INTO user(accountid, user_name, avatar_url, game_times, win_times, kills, harm, add_HP, alive_time, coin_num, integral, kill_his, alive_time_his, harm_his, add_HP_his, act_share_time, act_share_status, create_time, modify_time, first_fight, collect_status, keys_num, battle_re_times, shop_flush_times, kefu_status, sign_sum, box_num, diamond_num, sum_coin, pass_status, score, season_status, recharge_times_total, first_gift, season_time, free_coin, free_diamond, season_end_score, kill_modifytime, win_modifytime, rank_modifytime, vip_score, first_login, daily_first_login, daily_time, free_box, update_time, season_games, season_win, sea_max_kill, sea_max_hart, sea_avg_kill, free_lot_ticket, free_dou_lot_ticket, daily_order1, daily_order2, daily_order3, first_bee, newhand, coin_times, newInfo, first_day_ad, share_video_times, share_video_sums, act_video_status, act_ad_status, biogame_times, shop_view_times, new_first_equip, newhand2,game_times2, view_times2, guildcoin_num, new_second_equip, rmb_num, max_single_recharge, passcard, rmb_lot_ticket, daily_max_single, head_kuang_id, daily_score, daily_offline, create_user, sex, sumlot_coin) ' .
' VALUES(:accountid, :user_name, :avatar_url, 0, 0, 0, 0, 0, 0, 10000, 0, 0, 0, 0, 0, 0, 0, :create_time, :modify_time, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, :season_time, 0, 0, 0, 0, 0, 0, 0, 0, 0, :daily_time, 0,:update_time,0,0,0,0,0,0,0,0,0,0,0,0,0,:newInfo,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, 0, 0, 0, 0, 0, 0, 2, 0) ' .
' ON DUPLICATE KEY UPDATE accountid=:accountid, user_name=:user_name, avatar_url=:avatar_url, game_times=0, win_times=0, kills=0, harm=0, add_HP=0, alive_time=0, coin_num=0, integral=0, kill_his=0, alive_time_his=0, harm_his=0, add_HP_his=0, act_share_time=0, act_share_status=0, modify_time=:modify_time, first_fight=0, collect_status=0, keys_num=0, battle_re_times=0, shop_flush_times=0, kefu_status=0, sign_sum=0, box_num=0, diamond_num=0, sum_coin=0, pass_status=0, score=0, season_status=1, recharge_times_total=0, first_gift=0, season_time=:season_time, free_coin=0, free_diamond=0, season_end_score=0, kill_modifytime=0, win_modifytime=0, rank_modifytime=0, vip_score=0, first_login=0, daily_first_login=0, daily_time=:daily_time, free_box=0, update_time=:update_time, season_games=0, season_win=0, sea_max_kill=0, sea_max_hart=0, sea_avg_kill=0, free_lot_ticket=0, free_dou_lot_ticket=0, daily_order1=0, daily_order2=0, daily_order3=0, first_bee=0, newhand=0, coin_times=0, newInfo=:newInfo, first_day_ad=0, share_video_times=0, share_video_sums=0, act_video_status=0, act_ad_status=0, biogame_times=0, shop_view_times=0, new_first_equip=0, newhand2=0, game_times2=0,view_times2=0, guildcoin_num=0, new_second_equip=2, rmb_num=0, max_single_recharge=0, passcard=0, rmb_lot_ticket=0, daily_max_single=0, head_kuang_id=0, daily_score=0, daily_offline=0, create_user=0, sex=2, sumlot_coin=0;',
array(
':accountid' => $account_id,
':user_name' => $user_name,