diff --git a/webapp/controller/PassController.class.php b/webapp/controller/PassController.class.php index 749ae52..eb527e7 100644 --- a/webapp/controller/PassController.class.php +++ b/webapp/controller/PassController.class.php @@ -179,7 +179,7 @@ class PassController{ } } array_push($item_list, array( - 'id' => $id, + 'id' => $id - 1, 'type' => $t, 'point' => $seaReward['point'], 'item_id' => $drop_multiply[0], diff --git a/webapp/controller/PayController.class.php b/webapp/controller/PayController.class.php index 8c702a5..d52287f 100644 --- a/webapp/controller/PayController.class.php +++ b/webapp/controller/PayController.class.php @@ -526,6 +526,14 @@ class PayController{ phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家'); return; } + $row = $conn->execQueryOne('SELECT diamond_num, first_gift FROM user WHERE accountid=:accountid;', + array( + ':accountid' => $account_id + )); + if (!$row) { + phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家'); + return; + } $item_id = $_REQUEST['item_id']; $item_list = array(); $diamond_meta_table = require('../res/diamondshop@diamondshop.php'); @@ -542,14 +550,6 @@ class PayController{ } if ($diamond['coin_type'] == 10003) { //扣除钻石 - $row = $conn->execQueryOne('SELECT diamond_num FROM user WHERE accountid=:accountid;', - array( - ':accountid' => $account_id - )); - if (!$row) { - phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家'); - return; - } if ($row['diamond_num'] < $diamond['coin_num']) { phpcommon\sendError(ERR_USER_BASE + 3, '钻石不足'); return; @@ -566,6 +566,23 @@ class PayController{ return; } } + //首充礼包奖励 + if ($diamond['shop_type'] == 4) { + if ($row['first_gift'] == 1) { + phpcommon\sendError(ERR_USER_BASE + 4, '首充礼包已领取'); + return; + } + $ret = $conn->execScript('UPDATE user SET first_gift=1, modify_time=:modify_time ' . + ' WHERE accountid=:accountid;', + array( + ':accountid' => $account_id, + ':modify_time' => time() + )); + if (!$ret) { + die(); + return; + } + } } //添加道具 diff --git a/webapp/controller/SignController.class.php b/webapp/controller/SignController.class.php index 8994898..d511faa 100644 --- a/webapp/controller/SignController.class.php +++ b/webapp/controller/SignController.class.php @@ -362,6 +362,8 @@ class SignController{ if (!$share_ret) { die(); } + //刷新赛季奖励状态 + } } ?>