修改小胡bug

This commit is contained in:
aozhiwei 2024-10-28 19:14:47 +08:00
parent c1dc79744c
commit bc587c1f09
4 changed files with 28 additions and 14 deletions

View File

@ -31,10 +31,15 @@ class OutAppCircuitController extends BaseController {
} }
$address = getReqVal('address', ''); $address = getReqVal('address', '');
if (empty($address)){ if (empty($address)){
myself()->_rspErr(1, 'param error'); if (SERVER_ENV == _ONLINE) {
return; myself()->_rspErr(1, 'param error');
return;
}
} }
$user = User::findByAddress($address); $user = User::findByAddress($address);
if (SERVER_ENV != _ONLINE) {
$user = User::find('2_2006_I75DCdyQRllgGRYvT0wcGtPR9gbDUZws');
}
if (!$user){ if (!$user){
myself()->_rspErr(1, 'user not found'); myself()->_rspErr(1, 'user not found');
return; return;
@ -71,10 +76,15 @@ class OutAppCircuitController extends BaseController {
} }
$address = getReqVal('address', ''); $address = getReqVal('address', '');
if (empty($address)){ if (empty($address)){
myself()->_rspErr(1, 'param error'); if (SERVER_ENV == _ONLINE) {
return; myself()->_rspErr(1, 'param error');
return;
}
} }
$user = User::findByAddress($address); $user = User::findByAddress($address);
if (SERVER_ENV != _ONLINE) {
$user = User::find('2_2006_I75DCdyQRllgGRYvT0wcGtPR9gbDUZws');
}
if (!$user){ if (!$user){
myself()->_rspErr(1, 'user not found'); myself()->_rspErr(1, 'user not found');
return; return;
@ -193,7 +203,7 @@ class OutAppCircuitController extends BaseController {
++$ranking; ++$ranking;
$userDb = User::find($row['account_id']); $userDb = User::find($row['account_id']);
$heroDb = Hero::findByAccountId($userDb['account_id'],$userDb['hero_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; $heroId = $heroDb ? $heroDb['hero_id']:0;
$skinId = $skinDb ? $skinDb['skin_id']:0; $skinId = $skinDb ? $skinDb['skin_id']:0;
$rewardWeight = \mt\CircuitReward::getRewardWeight($ranking); $rewardWeight = \mt\CircuitReward::getRewardWeight($ranking);
@ -208,7 +218,7 @@ class OutAppCircuitController extends BaseController {
'ranking' => $ranking, 'ranking' => $ranking,
'weight' => $rewardWeight, 'weight' => $rewardWeight,
'score' => $row['cumulative_score'], 'score' => $row['cumulative_score'],
'score_boost' => $row['score_boost'], 'score_boost' => number_format($row['score_boost'], 2, '.', ''),
); );
array_push($rankingList,$info); array_push($rankingList,$info);
} }

View File

@ -3,8 +3,12 @@
namespace models; namespace models;
require_once('models/UserInvitationCode.php');
use mt; use mt;
use phpcommon\SqlHelper; use phpcommon\SqlHelper;
use models\UserInvitationCode;
class Circuit extends BaseModel class Circuit extends BaseModel
{ {
public static function updateScore($season,$score){ public static function updateScore($season,$score){
@ -93,7 +97,7 @@ class Circuit extends BaseModel
public static function getCircuitList($season){ public static function getCircuitList($season){
$rows = SqlHelper::ormSelect( $rows = SqlHelper::ormSelect(
myself()->_getSelfMysql(), myself()->_getMysql(''),
't_circuit_battle', 't_circuit_battle',
array( array(
'season' => $season 'season' => $season
@ -125,7 +129,7 @@ class Circuit extends BaseModel
public static function getCircuitPhaseList($season,$phase){ public static function getCircuitPhaseList($season,$phase){
$rows = SqlHelper::ormSelect( $rows = SqlHelper::ormSelect(
myself()->_getSelfMysql(), myself()->_getMysql(''),
't_circuit_battle_phase', 't_circuit_battle_phase',
array( array(
'season' => $season, 'season' => $season,

View File

@ -48,7 +48,7 @@ class HeroSkin extends BaseModel {
public static function find($uniid) public static function find($uniid)
{ {
$row = SqlHelper::ormSelectOne( $row = SqlHelper::ormSelectOne(
myself()->_getSelfMysql(), myself()->_getMysql(''),
't_hero_skin', 't_hero_skin',
array( array(
'idx' => $uniid, 'idx' => $uniid,
@ -75,7 +75,7 @@ class HeroSkin extends BaseModel {
public static function findByAccountId($accountId, $uniid) public static function findByAccountId($accountId, $uniid)
{ {
$row = SqlHelper::ormSelectOne( $row = SqlHelper::ormSelectOne(
myself()->_getSelfMysql(), myself()->_getMysql(''),
't_hero_skin', 't_hero_skin',
array( array(
'idx' => $uniid, 'idx' => $uniid,

View File

@ -20,7 +20,7 @@ class UserInvitationCode extends BaseModel
public static function findCodeByAccount($account){ public static function findCodeByAccount($account){
$row = SqlHelper::ormSelectOne( $row = SqlHelper::ormSelectOne(
myself()->_getSelfMysql(), myself()->_getMysql(''),
't_user_invitation_code', 't_user_invitation_code',
array( array(
'account_id' => $account, 'account_id' => $account,
@ -32,7 +32,7 @@ class UserInvitationCode extends BaseModel
public static function generateCode(){ public static function generateCode(){
$user = myself()->_getOrmUserInfo(); $user = myself()->_getOrmUserInfo();
SqlHelper::upsert( SqlHelper::upsert(
myself()->_getSelfMysql(), myself()->_getMysql(''),
't_user_invitation_code', 't_user_invitation_code',
array( array(
'account_id' => myself()->_getAccountId(), 'account_id' => myself()->_getAccountId(),
@ -51,7 +51,7 @@ class UserInvitationCode extends BaseModel
public static function getMyCodeBindCount($code){ public static function getMyCodeBindCount($code){
$rows = SqlHelper::ormSelect( $rows = SqlHelper::ormSelect(
myself()->_getSelfMysql(), myself()->_getMysql(''),
't_user_invitation_code_bind', 't_user_invitation_code_bind',
array( array(
'invitation_code' => $code, 'invitation_code' => $code,