From c741854c2e78a4d7b12104827210997b15ad6270 Mon Sep 17 00:00:00 2001 From: wangwei01 Date: Thu, 4 Jul 2019 11:50:31 +0800 Subject: [PATCH] 1 --- webapp/controller/ShareController.class.php | 26 ++++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/webapp/controller/ShareController.class.php b/webapp/controller/ShareController.class.php index e73c279..ca039c0 100644 --- a/webapp/controller/ShareController.class.php +++ b/webapp/controller/ShareController.class.php @@ -96,6 +96,7 @@ class ShareController{ if ($row['keys_num'] < 1) { phpcommon\sendError(ERR_USER_BASE + 3, '钥匙不足'); die(); + return; } $ret = $conn->execScript('UPDATE user SET keys_num=:keys_num, modify_time=:modify_time ' . ' WHERE accountid=:accountid;', @@ -401,6 +402,19 @@ class ShareController{ phpcommon\sendError(ERR_RETRY, '系统繁忙'); return; } + $row = $conn->execQueryOne('SELECT kefu_status FROM user WHERE accountid=:accountid;', + array( + ':accountid' => $account_id + )); + if (!$row) { + phpcommon\sendError(ERR_USER_BASE + 2, '没有这个玩家'); + return; + } + if ($row['kefu_status'] != 0) { + phpcommon\sendError(ERR_USER_BASE + 3, '客服奖励已领取'); + die(); + return; + } $item_list = array(); $item_id = 0; $item_num = 0; @@ -439,17 +453,17 @@ class ShareController{ 'item_id' => $item_id, 'item_num' => $item_num, )); - } - //更新状态 - $ret = $conn->execScript('UPDATE user SET kefu_status=1, modify_time=:modify_time ' . + //更新状态 + $ret = $conn->execScript('UPDATE user SET kefu_status=1, modify_time=:modify_time ' . ' WHERE accountid=:accountid;', array( ':accountid' => $account_id, ':modify_time' => time(), )); - if (!$ret) { - die(); - return; + if (!$ret) { + die(); + return; + } } echo json_encode(array( 'errcode' => $errcode,