1
This commit is contained in:
parent
7083eaeff5
commit
472046c2b0
@ -204,11 +204,12 @@ class AddReward {
|
||||
$this->addDiamond($item_id, $item_num, $accountid);
|
||||
} else {
|
||||
$nowTime = $row['active_time'];
|
||||
if ($row['active_time'] < time() + $time * 3600) {
|
||||
$nowTime = time() + $time * 3600;
|
||||
if ($time == 0) {
|
||||
$nowTime = 0;
|
||||
$status = 1;
|
||||
} else {
|
||||
if ($time == 0) {
|
||||
$nowTime = 0;
|
||||
if ($row['active_time'] < time() + $time * 3600) {
|
||||
$nowTime = time() + $time * 3600;
|
||||
}
|
||||
}
|
||||
$ret = $conn->execScript('UPDATE bag SET active_time=:active_time, status=:status, modify_time=:modify_time ' .
|
||||
|
@ -110,7 +110,7 @@ class BagController{
|
||||
));
|
||||
}
|
||||
} else {
|
||||
$ret = $conn->execScript('INSERT INTO bag(accountid, id, color_id, status, active_time, create_time, modify_time) ' .
|
||||
$ret = $conn->execScript('INSERT INTO bag(accountid, id, color_id, status, active_time, create_time, modify_time) ' .
|
||||
' VALUES(:account_id, :id, 0, :status, :active_time, :create_time, :modify_time) ' .
|
||||
' ON DUPLICATE KEY UPDATE accountid=:account_id, id=:id, color_id=0, status=:status, active_time=:active_time, modify_time=:modify_time;',
|
||||
array(
|
||||
|
@ -165,6 +165,7 @@ class ShopController{
|
||||
|
||||
public function buyItem()
|
||||
{
|
||||
error_log(11111111111);
|
||||
$account_id = $_REQUEST['account_id'];
|
||||
//登录校验
|
||||
$login = loginVerify($account_id, $_REQUEST['session_id']);
|
||||
@ -177,6 +178,8 @@ class ShopController{
|
||||
return;
|
||||
}
|
||||
$shop_uuid = $_REQUEST['shop_uuid'];
|
||||
error_log($shop_uuid);
|
||||
error_log($shop_id);
|
||||
$item_id = 0;
|
||||
$item_num = 0;
|
||||
$price = 0;
|
||||
@ -225,6 +228,10 @@ class ShopController{
|
||||
$r->set($shop_uuid, json_encode($user_db));
|
||||
$r -> pexpire($shop_uuid, 1000 * 3600 * 24);
|
||||
//增加奖励
|
||||
error_log(2222222222222222);
|
||||
error_log($item_id);
|
||||
error_log($item_num);
|
||||
error_log($time);
|
||||
$addreward = new classes\AddReward();
|
||||
$all_item_list = $addreward->addReward($item_id, $item_num, $account_id, $time);
|
||||
$coin_num = $addreward->getCoinNum($account_id);
|
||||
|
Loading…
x
Reference in New Issue
Block a user