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