diff --git a/tools/rankserver/__pycache__/app.cpython-36.pyc b/tools/rankserver/__pycache__/app.cpython-36.pyc index d3ad398..6ae2a25 100644 Binary files a/tools/rankserver/__pycache__/app.cpython-36.pyc and b/tools/rankserver/__pycache__/app.cpython-36.pyc differ diff --git a/webapp/controller/RoleController.class.php b/webapp/controller/RoleController.class.php index 7bc881c..c47c1e8 100644 --- a/webapp/controller/RoleController.class.php +++ b/webapp/controller/RoleController.class.php @@ -168,23 +168,25 @@ class RoleController{ die(); return; } - if ($user_name != $row['user_name']) { - $ret = $conn->execScript('UPDATE user SET user_name=:user_name, modify_time=:modify_time ' . - ' WHERE accountid=:accountid;', - array( - ':accountid' => $account_id, - ':user_name' => $user_name, - ':modify_time' => time() - )); - } - if ($avatar_url != $row['avatar_url']) { - $ret = $conn->execScript('UPDATE user SET avatar_url=:avatar_url, modify_time=:modify_time ' . - ' WHERE accountid=:accountid;', - array( - ':accountid' => $account_id, - ':avatar_url' => $avatar_url, - ':modify_time' => time() - )); + if ($avatar_url != '') { + if ($user_name != $row['user_name']) { + $ret = $conn->execScript('UPDATE user SET user_name=:user_name, modify_time=:modify_time ' . + ' WHERE accountid=:accountid;', + array( + ':accountid' => $account_id, + ':user_name' => $user_name, + ':modify_time' => time() + )); + } + if ($avatar_url != $row['avatar_url']) { + $ret = $conn->execScript('UPDATE user SET avatar_url=:avatar_url, modify_time=:modify_time ' . + ' WHERE accountid=:accountid;', + array( + ':accountid' => $account_id, + ':avatar_url' => $avatar_url, + ':modify_time' => time() + )); + } } $nowTime = phpcommon\getdayseconds(time()); $daily_first_login = $row['daily_first_login']; diff --git a/webapp/controller/ShareController.class.php b/webapp/controller/ShareController.class.php index 70b418e..610cf2c 100644 --- a/webapp/controller/ShareController.class.php +++ b/webapp/controller/ShareController.class.php @@ -385,14 +385,20 @@ class ShareController{ return; } $item_list = array(); + $addreward = new classes\AddReward(); if ($ach_id != 6) { $array = $this->getExplode($sh['rewards']); array_push($item_list, array( 'item_id' => $array[0][0], 'item_num' => $array[0][1], )); - $addreward = new classes\AddReward(); $addreward->addReward($array[0][0], $array[0][1], $account_id); + } else if ($ach_id == 6) { + array_push($item_list, array( + 'item_id' => 10003, + 'item_num' => 50, + )); + $addreward->addReward(10003, 50, $account_id); } //更新状态 $ret = $conn->execScript('UPDATE share_achievement SET status=1, modify_time=:modify_time ' . @@ -454,11 +460,15 @@ class ShareController{ phpcommon\sendError(ERR_USER_BASE + 4, '未达到人数要求'); return; } - $array = $this->getExplode($sh['rewards']); $p = $this->getParameter(REWARD_TIMES); $times = $p['param_value'] - 1; $addreward = new classes\AddReward(); - $addreward->addReward($array[0][0], $array[0][1] * $times, $account_id); + if ($ach_id != 6) { + $array = $this->getExplode($sh['rewards']); + $addreward->addReward($array[0][0], $array[0][1] * $times, $account_id); + } else if ($ach_id == 6) { + $addreward->addReward(10003, 50 * $times, $account_id); + } echo json_encode(array( 'errcode' => 0, 'errmsg' => '',