This commit is contained in:
aozhiwei 2019-08-29 12:14:39 +08:00
parent 02cefa7303
commit 14f45aab6d
4 changed files with 50 additions and 29 deletions

View File

@ -721,7 +721,7 @@ class ActivityController{
':red_type' => $_REQUEST['type'],
':red_date' => phpcommon\getdayseconds(time())
));
if ($row['red_sum'] + $item_num > $limit) {
if ($row['red_sum'] + $item['item_num'] > $limit) {
phpcommon\sendError(ERR_USER_BASE + 3, '今日红包已领完');
return;
}
@ -740,7 +740,7 @@ class ActivityController{
protected function getRedMysql()
{
$mysql_conf = getMysqlConfig();
$mysql_conf = getMysqlConfig(crc32(''));
$conn = new phpcommon\Mysql(array(
'host' => $mysql_conf['host'],
'port' => $mysql_conf['port'],
@ -855,6 +855,7 @@ class ActivityController{
$param['re_user_name'] = $re_user_name;
$param['amount'] = $amount;
$param['desc'] = $desc;
$param['account_id'] = $account_id;
$res = '';
if (!phpcommon\HttpClient::get($url, $param, $res)) {
phpcommon\sendError(ERR_RETRY, '系统繁忙');
@ -894,8 +895,8 @@ class ActivityController{
}
} else {
$sum = $row['red_sum'] + $item_num;
$ret = $red_conn->execScript('UPDATE redpack set red_sum=:red_sum, red_date=:red_date, modify_time=:modify_time ' .
' WHERE red_type=:red_type;',
$ret = $red_conn->execScript('UPDATE redpack set red_sum=:red_sum, modify_time=:modify_time ' .
' WHERE red_type=:red_type AND red_date=:red_date;',
array(
':red_sum' => $sum,
':red_type' => $type,

View File

@ -135,7 +135,8 @@ class RoleController{
'pass_status' => 0,
'season_status' => 1,
'first_gift' => 0,
'sum_coin' => 0
'sum_coin' => 0,
'recharge_times_total' => 0
));
} else {
echo json_encode(array(
@ -159,7 +160,8 @@ class RoleController{
'pass_status' => $row['pass_status'],
'season_status' => $row['season_status'],
'first_gift' => $row['first_gift'],
'sum_coin' => $row['sum_coin']
'sum_coin' => $row['sum_coin'],
'recharge_times_total' => $row['recharge_times_total']
));
}
}
@ -672,20 +674,21 @@ class RoleController{
return;
}
$member_list = array();
for ($i = 1; $i <= 100; $i++) {
$num = 1;
$robot_id = 1000 + $i;
$rob = $this->getRobot($robot_id, $num);
array_push ($member_list, array(
'account_id' => $rob['id'],
'name' => $rob['name'],
'avatar_url' => $rob['avatar_url'],
));
}
$i = Rand(1, 100);
$coin = Rand(1, 100) * 0.01;
$num = 1;
$robot_id = 1000 + $i;
$rob = $this->getRobot($robot_id, $num);
array_push ($member_list, array(
'account_id' => $rob['id'],
'name' => $rob['name'],
'avatar_url' => $rob['avatar_url'],
));
echo json_encode(array(
'errcode' => 0,
'errmsg' => '',
'member_list' => $member_list
'member_list' => $member_list,
'num' => $coin,
));
}

View File

@ -37,25 +37,42 @@ class ServerSwitchController {
die();
}*/
$payable = 0;
$recharge_times = isset($_REQUEST['recharge_times']) ? $_REQUEST['recharge_times'] : 0;
/*
玩家第一天不开放
玩家进来第二天玩了7-8次战斗后开放(非北上广并且每天重置战斗次数)
北上广第三天开放
1玩家进入第一天战斗7次开放充值除北上广深成
2玩家进入第二天战斗7次已充值玩家战斗2次除北上广深成
3玩家进入第三天战斗7次已充值玩家战斗2次。
*/
if (phpcommon\isValidSessionId($_REQUEST['account_id'],
$_REQUEST['session_id'])) {
$register_time = phpcommon\extractRegisterTimeFromSessionId($_REQUEST['session_id']);
$nowtime = time();
if ($nowtime - $register_time > 3600 * 24) {
if ($this->isForbidCity() && $nowtime - $register_time > 3600 * 24 * 2) {
if ($_REQUEST['battle_times'] >= 8) {
$payable = 1;
}
$register_time = phpcommon\getdayseconds($register_time);
$nowtime = phpcommon\getdayseconds($nowtime);
if ($nowtime - $register_time > 3600 * 24 * 2) {
//第三天
if ($_REQUEST['battle_times'] >= 7) {
$payable = 1;
} else if ($recharge_times > 0 && $_REQUEST['battle_times'] >= 2) {
$payable = 1;
}
} else if ($nowtime - $register_time > 3600 * 24 * 1) {
//第二天
if ($this->isForbidCity()) {
} else {
if ($_REQUEST['battle_times'] >= 8) {
if ($_REQUEST['battle_times'] >= 7) {
$payable = 1;
} else if ($recharge_times > 0 && $_REQUEST['battle_times'] >= 2) {
$payable = 1;
}
}
} else {
//第一天
if ($this->isForbidCity()) {
} else if ($_REQUEST['battle_times'] >= 7) {
$payable = 1;
}
}
}
echo json_encode(array(

View File

@ -195,7 +195,7 @@ class SignController{
$dayid = ($week - 1) * 7;
//如果大于配置表最后一周,按最后一周奖励
$g_conf_sign_cluster = require('../res/signDaily@signDaily.php');
if ($dayid + 90000 > count($g_conf_sign_cluster)) {
if ($dayid > count($g_conf_sign_cluster)) {
$dayid = count($g_conf_sign_cluster) - 7;
}
for ($day = $dayid + 1; $day <= $dayid + 7; $day++)
@ -261,7 +261,7 @@ class SignController{
$dayid = ($week - 1) * 7 + $_REQUEST['sign_id'];
//如果大于配置表最后一周,按最后一周奖励
$g_conf_sign_cluster = require('../res/signDaily@signDaily.php');
if ($dayid + 90000 > count($g_conf_sign_cluster)) {
if ($dayid > count($g_conf_sign_cluster)) {
$dayid = count($g_conf_sign_cluster) - 7;
}
$s = $this->getSign($dayid + 90000);
@ -307,7 +307,7 @@ class SignController{
$dayid = ($week - 1) * 7 + $_REQUEST['sign_id'];
//如果大于配置表最后一周,按最后一周奖励
$g_conf_sign_cluster = require('../res/signDaily@signDaily.php');
if ($dayid + 90000 > count($g_conf_sign_cluster)) {
if ($dayid > count($g_conf_sign_cluster)) {
$dayid = count($g_conf_sign_cluster) - 7;
}
$s = $this->getSign($day + 90000);