From 6da63e83384d3171a5a4028666606311c317c5b9 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 1 Sep 2020 21:12:11 +0800 Subject: [PATCH] 1 --- webapp/controller/BagController.class.php | 23 --------------- webapp/controller/EquipController.class.php | 11 ------- webapp/controller/HangController.class.php | 23 --------------- webapp/controller/RoleController.class.php | 32 +++++++++++++++++++++ 4 files changed, 32 insertions(+), 57 deletions(-) diff --git a/webapp/controller/BagController.class.php b/webapp/controller/BagController.class.php index 6de09c4..ca0e431 100644 --- a/webapp/controller/BagController.class.php +++ b/webapp/controller/BagController.class.php @@ -110,29 +110,6 @@ class BagController{ 'num' => $row['num'], )); } - } else { - $ret = $conn->execScript('INSERT INTO bag(accountid, id, color_id, status, num, active_time, create_time, modify_time) ' . - ' VALUES(:account_id, :id, 0, :status, 0, :active_time, :create_time, :modify_time) ' . - ' ON DUPLICATE KEY UPDATE accountid=:account_id, id=:id, color_id=0, status=:status, num=0, active_time=:active_time, modify_time=:modify_time;', - array( - ':account_id' => $account_id, - ':id' => 16001, - ':active_time' => 0, - ':status' => 0, - ':create_time' => time(), - ':modify_time' => time() - )); - if(!$ret){ - die(); - return; - } - array_push($bag_list, array( - 'id' => 16001, - 'active_time' => 0, - 'status' => 0, - 'color_id' => 0, - 'num' => 0, - )); } echo json_encode(array( 'errcode' => 0, diff --git a/webapp/controller/EquipController.class.php b/webapp/controller/EquipController.class.php index 11e2892..1e2d347 100644 --- a/webapp/controller/EquipController.class.php +++ b/webapp/controller/EquipController.class.php @@ -123,17 +123,6 @@ class EquipController{ die(); return; } - $ret1 = $conn->execScript('INSERT INTO bag(accountid, id, color_id, status, num, active_time, create_time, modify_time) ' . - ' VALUES(:account_id, :id, 0, :status, 200, :active_time, :create_time, :modify_time) ' . - ' ON DUPLICATE KEY UPDATE accountid=:account_id, id=:id, color_id=0, status=:status, num=200, active_time=:active_time, modify_time=:modify_time;', - array( - ':account_id' => $account_id, - ':id' => 18006, - ':active_time' => 0, - ':status' => 0, - ':create_time' => time(), - ':modify_time' => time() - )); array_push($equip_list, array( 'id' => $id, 'lv' => 0, diff --git a/webapp/controller/HangController.class.php b/webapp/controller/HangController.class.php index 554fea8..e3696c6 100644 --- a/webapp/controller/HangController.class.php +++ b/webapp/controller/HangController.class.php @@ -299,29 +299,6 @@ class HangController{ 'num' => $row['num'], )); } - } else { - $ret = $conn->execScript('INSERT INTO bag(accountid, id, color_id, status, num, active_time, create_time, modify_time) ' . - ' VALUES(:account_id, :id, 0, :status, 0, :active_time, :create_time, :modify_time) ' . - ' ON DUPLICATE KEY UPDATE accountid=:account_id, id=:id, color_id=0, status=:status, num=0, active_time=:active_time, modify_time=:modify_time;', - array( - ':account_id' => $account_id, - ':id' => 16001, - ':active_time' => 0, - ':status' => 0, - ':create_time' => time(), - ':modify_time' => time() - )); - if(!$ret){ - die(); - return; - } - array_push($bag_list, array( - 'id' => 16001, - 'active_time' => 0, - 'status' => 0, - 'color_id' => 0, - 'num' => 0, - )); } //吃鸡 $row = $conn->execQueryOne('SELECT daily_order1, daily_order2, daily_order3 FROM user WHERE accountid=:accountid;', diff --git a/webapp/controller/RoleController.class.php b/webapp/controller/RoleController.class.php index 55db541..ac06295 100644 --- a/webapp/controller/RoleController.class.php +++ b/webapp/controller/RoleController.class.php @@ -217,6 +217,8 @@ class RoleController{ die(); return; } + //新玩家赠送材料,表情 + $this->newPlayerReward($account_id); echo json_encode(array( 'errcode' => 0, 'errmsg' => '', @@ -390,6 +392,36 @@ class RoleController{ } } + protected function newPlayerReward($account_id) + { + $conn = $this->getMysql($account_id); + if (!$conn) { + phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家'); + die(); + } + $ret1 = $conn->execScript('INSERT INTO bag(accountid, id, color_id, status, num, active_time, create_time, modify_time) ' . + ' VALUES(:account_id, :id, 0, :status, 200, :active_time, :create_time, :modify_time) ' . + ' ON DUPLICATE KEY UPDATE accountid=:account_id, id=:id, color_id=0, status=:status, num=200, active_time=:active_time, modify_time=:modify_time;', + array( + ':account_id' => $account_id, + ':id' => 18006, + ':active_time' => 0, + ':status' => 0, + ':create_time' => time(), + ':modify_time' => time() + )); + $ret2 = $conn->execScript('INSERT INTO bag(accountid, id, color_id, status, num, active_time, create_time, modify_time) ' . + ' VALUES(:account_id, :id, 0, :status, 0, :active_time, :create_time, :modify_time) ' . + ' ON DUPLICATE KEY UPDATE accountid=:account_id, id=:id, color_id=0, status=:status, num=0, active_time=:active_time, modify_time=:modify_time;', + array( + ':account_id' => $account_id, + ':id' => 16001, + ':active_time' => 0, + ':status' => 0, + ':create_time' => time(), + ':modify_time' => time() + )); + } protected function updateSeasonStatus($account_id) { $conn = $this->getMysql($account_id);