diff --git a/webapp/controller/OutAppCircuitController.class.php b/webapp/controller/OutAppCircuitController.class.php index a9649ed0..e96e3326 100644 --- a/webapp/controller/OutAppCircuitController.class.php +++ b/webapp/controller/OutAppCircuitController.class.php @@ -31,10 +31,15 @@ class OutAppCircuitController extends BaseController { } $address = getReqVal('address', ''); if (empty($address)){ - myself()->_rspErr(1, 'param error'); - return; + if (SERVER_ENV == _ONLINE) { + myself()->_rspErr(1, 'param error'); + return; + } } $user = User::findByAddress($address); + if (SERVER_ENV != _ONLINE) { + $user = User::find('2_2006_I75DCdyQRllgGRYvT0wcGtPR9gbDUZws'); + } if (!$user){ myself()->_rspErr(1, 'user not found'); return; @@ -71,10 +76,15 @@ class OutAppCircuitController extends BaseController { } $address = getReqVal('address', ''); if (empty($address)){ - myself()->_rspErr(1, 'param error'); - return; + if (SERVER_ENV == _ONLINE) { + myself()->_rspErr(1, 'param error'); + return; + } } $user = User::findByAddress($address); + if (SERVER_ENV != _ONLINE) { + $user = User::find('2_2006_I75DCdyQRllgGRYvT0wcGtPR9gbDUZws'); + } if (!$user){ myself()->_rspErr(1, 'user not found'); return; @@ -193,7 +203,7 @@ class OutAppCircuitController extends BaseController { ++$ranking; $userDb = User::find($row['account_id']); $heroDb = Hero::findByAccountId($userDb['account_id'],$userDb['hero_id']); - $skinDb = HeroSkin::find($heroDb['skin_id']); + $skinDb = HeroSkin::findByAccountId($heroDb['skin_id'], $userDb['account_id']); $heroId = $heroDb ? $heroDb['hero_id']:0; $skinId = $skinDb ? $skinDb['skin_id']:0; $rewardWeight = \mt\CircuitReward::getRewardWeight($ranking); @@ -208,7 +218,7 @@ class OutAppCircuitController extends BaseController { 'ranking' => $ranking, 'weight' => $rewardWeight, 'score' => $row['cumulative_score'], - 'score_boost' => $row['score_boost'], + 'score_boost' => number_format($row['score_boost'], 2, '.', ''), ); array_push($rankingList,$info); } diff --git a/webapp/models/Circuit.php b/webapp/models/Circuit.php index 4a71645a..eccc56d7 100644 --- a/webapp/models/Circuit.php +++ b/webapp/models/Circuit.php @@ -3,8 +3,12 @@ namespace models; +require_once('models/UserInvitationCode.php'); + use mt; use phpcommon\SqlHelper; +use models\UserInvitationCode; + class Circuit extends BaseModel { public static function updateScore($season,$score){ @@ -93,7 +97,7 @@ class Circuit extends BaseModel public static function getCircuitList($season){ $rows = SqlHelper::ormSelect( - myself()->_getSelfMysql(), + myself()->_getMysql(''), 't_circuit_battle', array( 'season' => $season @@ -125,7 +129,7 @@ class Circuit extends BaseModel public static function getCircuitPhaseList($season,$phase){ $rows = SqlHelper::ormSelect( - myself()->_getSelfMysql(), + myself()->_getMysql(''), 't_circuit_battle_phase', array( 'season' => $season, diff --git a/webapp/models/HeroSkin.php b/webapp/models/HeroSkin.php index abde1292..ce978187 100644 --- a/webapp/models/HeroSkin.php +++ b/webapp/models/HeroSkin.php @@ -48,7 +48,7 @@ class HeroSkin extends BaseModel { public static function find($uniid) { $row = SqlHelper::ormSelectOne( - myself()->_getSelfMysql(), + myself()->_getMysql(''), 't_hero_skin', array( 'idx' => $uniid, @@ -75,7 +75,7 @@ class HeroSkin extends BaseModel { public static function findByAccountId($accountId, $uniid) { $row = SqlHelper::ormSelectOne( - myself()->_getSelfMysql(), + myself()->_getMysql(''), 't_hero_skin', array( 'idx' => $uniid, diff --git a/webapp/models/UserInvitationCode.php b/webapp/models/UserInvitationCode.php index b1bb5ffb..810df4a5 100644 --- a/webapp/models/UserInvitationCode.php +++ b/webapp/models/UserInvitationCode.php @@ -20,7 +20,7 @@ class UserInvitationCode extends BaseModel public static function findCodeByAccount($account){ $row = SqlHelper::ormSelectOne( - myself()->_getSelfMysql(), + myself()->_getMysql(''), 't_user_invitation_code', array( 'account_id' => $account, @@ -32,7 +32,7 @@ class UserInvitationCode extends BaseModel public static function generateCode(){ $user = myself()->_getOrmUserInfo(); SqlHelper::upsert( - myself()->_getSelfMysql(), + myself()->_getMysql(''), 't_user_invitation_code', array( 'account_id' => myself()->_getAccountId(), @@ -51,7 +51,7 @@ class UserInvitationCode extends BaseModel public static function getMyCodeBindCount($code){ $rows = SqlHelper::ormSelect( - myself()->_getSelfMysql(), + myself()->_getMysql(''), 't_user_invitation_code_bind', array( 'invitation_code' => $code, @@ -137,4 +137,4 @@ class UserInvitationCode extends BaseModel } -} \ No newline at end of file +}