adjust draw award
This commit is contained in:
parent
5a9f7230c7
commit
f359f9bae8
@ -149,7 +149,7 @@ class AddReward
|
|||||||
'SELECT num FROM bag WHERE accountid=:accountid AND id=:id;',
|
'SELECT num FROM bag WHERE accountid=:accountid AND id=:id;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $accountid,
|
':accountid' => $accountid,
|
||||||
'id' => $id
|
':id' => $id
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
if (!$row && $id != 0) {
|
if (!$row && $id != 0) {
|
||||||
|
@ -77,7 +77,7 @@ class RechargeActivity
|
|||||||
}
|
}
|
||||||
$nowTime = time();
|
$nowTime = time();
|
||||||
$todaysecs = phpcommon\getdayseconds($nowTime);
|
$todaysecs = phpcommon\getdayseconds($nowTime);
|
||||||
$daysumtarget = metatable\getParameterById(RECHARGE_TARGET) * 10;
|
$daysumtarget = intval(metatable\getParameterById(RECHARGE_TARGET)) * 10;
|
||||||
foreach ($activityconf as $itemconf) {
|
foreach ($activityconf as $itemconf) {
|
||||||
if ($nowTime < strtotime($itemconf['time1']) || $nowTime > strtotime($itemconf['time2'])) {
|
if ($nowTime < strtotime($itemconf['time1']) || $nowTime > strtotime($itemconf['time2'])) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -1818,11 +1818,11 @@ class ActivityController
|
|||||||
return;
|
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) {
|
if (sizeof($cost_strings) > 1) {
|
||||||
|
$count = $cost_strings[1];
|
||||||
if ($cost_strings[0] == 10003) {
|
if ($cost_strings[0] == 10003) {
|
||||||
$count = $cost_strings[1];
|
|
||||||
|
|
||||||
$row = $conn->execQueryOne(
|
$row = $conn->execQueryOne(
|
||||||
'SELECT diamond_num, first_gift, free_coin, free_diamond FROM user WHERE accountid=:accountid;',
|
'SELECT diamond_num, first_gift, free_coin, free_diamond FROM user WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
@ -1855,8 +1855,33 @@ class ActivityController
|
|||||||
$rechargeactivity = new classes\RechargeActivity();
|
$rechargeactivity = new classes\RechargeActivity();
|
||||||
$rechargeactivity->triggerConsume($account_id, $count);
|
$rechargeactivity->triggerConsume($account_id, $count);
|
||||||
} else {
|
} else {
|
||||||
phpcommon\sendError(ERR_USER_BASE + 3, '货币不足');
|
$row = $conn->execQueryOne(
|
||||||
return;
|
'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 {
|
} else {
|
||||||
die();
|
die();
|
||||||
@ -1883,12 +1908,20 @@ class ActivityController
|
|||||||
die();
|
die();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for ($j = 0; $j < $extra_times; $j++) {
|
|
||||||
$item_list = metatable\getDropAllListById($extra_id, $item_list);
|
if ($onedraw){
|
||||||
}
|
|
||||||
for ($i = 0; $i < $times; $i++) {
|
|
||||||
$item_list = metatable\getDropAllListById($drop_id, $item_list);
|
$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();
|
$all_item_list = array();
|
||||||
$addreward = new classes\AddReward();
|
$addreward = new classes\AddReward();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user