adjust draw award

This commit is contained in:
yangduo 2025-03-27 15:38:18 +08:00
parent 5a9f7230c7
commit f359f9bae8
3 changed files with 44 additions and 11 deletions

View File

@ -149,7 +149,7 @@ class AddReward
'SELECT num FROM bag WHERE accountid=:accountid AND id=:id;',
array(
':accountid' => $accountid,
'id' => $id
':id' => $id
)
);
if (!$row && $id != 0) {

View File

@ -77,7 +77,7 @@ class RechargeActivity
}
$nowTime = time();
$todaysecs = phpcommon\getdayseconds($nowTime);
$daysumtarget = metatable\getParameterById(RECHARGE_TARGET) * 10;
$daysumtarget = intval(metatable\getParameterById(RECHARGE_TARGET)) * 10;
foreach ($activityconf as $itemconf) {
if ($nowTime < strtotime($itemconf['time1']) || $nowTime > strtotime($itemconf['time2'])) {
continue;

View File

@ -1818,11 +1818,11 @@ class ActivityController
return;
}
$cost_strings = explode(":", $dr["onecost"]);
$onedraw = !isset($_REQUEST['type']) || $_REQUEST['type'] == 0;
$cost_strings = $onedraw ? explode(":", $dr["onecost"]) : explode(":", $dr['tencost']);
if (sizeof($cost_strings) > 1) {
$count = $cost_strings[1];
if ($cost_strings[0] == 10003) {
$count = $cost_strings[1];
$row = $conn->execQueryOne(
'SELECT diamond_num, first_gift, free_coin, free_diamond FROM user WHERE accountid=:accountid;',
array(
@ -1855,8 +1855,33 @@ class ActivityController
$rechargeactivity = new classes\RechargeActivity();
$rechargeactivity->triggerConsume($account_id, $count);
} else {
phpcommon\sendError(ERR_USER_BASE + 3, '货币不足');
return;
$row = $conn->execQueryOne(
'SELECT num FROM bag WHERE accountid=:accountid AND id=:id;',
array(
':accountid' => $account_id,
':id' => $id
)
);
if (!$row || $row['num'] < $count) {
phpcommon\sendError(ERR_USER_BASE + 3, '道具不足');
return;
}
$ret = $conn->execScript(
'UPDATE bag SET num=:num, modify_time=:modify_time ' .
' WHERE accountid=:accountid AND id=:id;',
array(
':accountid' => $account_id,
'id' => $id,
':num' => $row['num'] - $count,
':modify_time' => time()
)
);
if (!$ret) {
die();
return;
}
}
} else {
die();
@ -1883,12 +1908,20 @@ class ActivityController
die();
return;
}
for ($j = 0; $j < $extra_times; $j++) {
$item_list = metatable\getDropAllListById($extra_id, $item_list);
}
for ($i = 0; $i < $times; $i++) {
if ($onedraw){
$item_list = metatable\getDropAllListById($drop_id, $item_list);
} else {
for ($j = 0; $j < 10; $j++) {
$item_list = metatable\getDropAllListById($extra_id, $item_list);
}
}
// for ($j = 0; $j < $extra_times; $j++) {
// $item_list = metatable\getDropAllListById($extra_id, $item_list);
// }
// for ($i = 0; $i < $times; $i++) {
// $item_list = metatable\getDropAllListById($drop_id, $item_list);
// }
$all_item_list = array();
$addreward = new classes\AddReward();