diff --git a/webapp/controller/NPlayerInfoController.class.php b/webapp/controller/NPlayerInfoController.class.php index 27dbb01..c7ddb1b 100644 --- a/webapp/controller/NPlayerInfoController.class.php +++ b/webapp/controller/NPlayerInfoController.class.php @@ -201,18 +201,29 @@ class NPlayerInfoController extends BaseAuthedController { $nickName = $_REQUEST['nickName']; $conn = $this->getMysql($account_id); $code = 100; + $itemID = 10106; + $itemNum = 1; - phpcommon\SqlHelper::update - ($this->getSelfMysql(), - 'user', - array( - 'accountid' => $this->getAccountId() - ), - array( - 'user_name' => $nickName - ) - ); - + $itemArr = array(); + $deleteItem = array("item_id"=>$itemID,"item_num"=>$itemNum); + array_push($itemArr,$deleteItem); + $code = $this->deleteItem($deleteItem); + if($code == 100) + { + $this->decItem($itemArr); + + error_log("改名测试======".$code); + phpcommon\SqlHelper::update + ($this->getSelfMysql(), + 'user', + array( + 'accountid' => $this->getAccountId() + ), + array( + 'user_name' => $nickName + ) + ); + } $this->sendDataToClient($code,"changeNickName",$nickName); // $sqlStr = "SELECT * FROM user WHERE accountid=:accountid; ";