1
This commit is contained in:
parent
360a1ed1e0
commit
abc4bab88e
@ -28,4 +28,22 @@ class TicketConsumeRecord extends BaseModel {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getRecord($matchRoomUuid){
|
||||||
|
if (!self::$matchRoomUuid || self::$matchRoomUuid != $matchRoomUuid){
|
||||||
|
self::$matchRoomUuid = $matchRoomUuid;
|
||||||
|
$rows = SqlHelper::ormSelect(
|
||||||
|
myself()->_getSelfMysql(),
|
||||||
|
't_ticket_consume_record',
|
||||||
|
array(
|
||||||
|
'match_room_uuid' => $matchRoomUuid,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
self::$ticketNum = count($rows);
|
||||||
|
}
|
||||||
|
return self::$ticketNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static $matchRoomUuid = null;
|
||||||
|
private static $ticketNum = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ require_once('models/BattleSettlement.php');
|
|||||||
require_once('models/Hero.php');
|
require_once('models/Hero.php');
|
||||||
require_once('models/HashRate.php');
|
require_once('models/HashRate.php');
|
||||||
require_once('models/Season.php');
|
require_once('models/Season.php');
|
||||||
|
require_once('models/TicketConsumeRecord.php');
|
||||||
|
|
||||||
require_once('mt/MapMode.php');
|
require_once('mt/MapMode.php');
|
||||||
require_once('mt/Rank.php');
|
require_once('mt/Rank.php');
|
||||||
@ -16,6 +17,7 @@ require_once('services/PropertyChgService.php');
|
|||||||
require_once('services/LogService.php');
|
require_once('services/LogService.php');
|
||||||
require_once('phpcommon/tglog.php');
|
require_once('phpcommon/tglog.php');
|
||||||
|
|
||||||
|
use models\TicketConsumeRecord;
|
||||||
use mt;
|
use mt;
|
||||||
use services;
|
use services;
|
||||||
use phpcommon;
|
use phpcommon;
|
||||||
@ -47,6 +49,7 @@ class RoomBattleDataService extends BaseService {
|
|||||||
public $maxLevel= 0;
|
public $maxLevel= 0;
|
||||||
public $maxAlive= 0;
|
public $maxAlive= 0;
|
||||||
public $realUserCount= 0;
|
public $realUserCount= 0;
|
||||||
|
public $matchRoomUuid= 0;
|
||||||
public $logData = array();
|
public $logData = array();
|
||||||
|
|
||||||
|
|
||||||
@ -73,6 +76,7 @@ class RoomBattleDataService extends BaseService {
|
|||||||
$member['battle_score'] = round($battleScore,4);
|
$member['battle_score'] = round($battleScore,4);
|
||||||
|
|
||||||
// //验证非机器人
|
// //验证非机器人
|
||||||
|
$this->matchRoomUuid = getXVal($member,'match_room_uuid', 0);
|
||||||
$teamRanked = getXVal($member,'pvp_team_rank', 0);
|
$teamRanked = getXVal($member,'pvp_team_rank', 0);
|
||||||
$winningPro = getXVal($member,'winningPro', 0);
|
$winningPro = getXVal($member,'winningPro', 0);
|
||||||
$account = getXVal($member,'account_id', 0);
|
$account = getXVal($member,'account_id', 0);
|
||||||
@ -196,17 +200,18 @@ class RoomBattleDataService extends BaseService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($gold > 0){
|
|
||||||
// $strArr = explode("|",$rewardMeta['goldParam']);
|
|
||||||
$coefficientArr = explode(";",$rewardMeta['goldParam']);
|
$coefficientArr = explode(";",$rewardMeta['goldParam']);
|
||||||
$coefficient = isset($coefficientArr[$teamRank-1]) ? $coefficientArr[$teamRank-1] : 0;
|
$coefficient = isset($coefficientArr[$teamRank-1]) ? $coefficientArr[$teamRank-1] : 0;
|
||||||
if ($this->mapMode == mt\MapMode::GOLD_MODE){
|
if ($this->mapMode == mt\MapMode::GOLD_MODE){
|
||||||
$gold = floor($gold * $coefficient * ($battleScore / $teamScoreAvg));
|
$gold = floor($gold * $coefficient * ($battleScore / $teamScoreAvg));
|
||||||
}
|
}
|
||||||
if ($this->mapMode == mt\MapMode::BET_MODE){
|
if ($this->mapMode == mt\MapMode::BET_MODE){
|
||||||
$gold = floor($gold * $this->realUserCount * $coefficient * ($battleScore / $teamScore));
|
$ticketMeta = \mt\Item::get(900006);
|
||||||
}
|
$baseGold = $ticketMeta['gold'];
|
||||||
|
$ticketNum = TicketConsumeRecord::getRecord($this->matchRoomUuid);
|
||||||
|
$gold = floor($ticketMeta['gold'] * $ticketNum * $coefficient * ($battleScore / $teamScore));
|
||||||
}
|
}
|
||||||
|
|
||||||
$baseValue = $gold;
|
$baseValue = $gold;
|
||||||
if ($this->mapMode == mt\MapMode::GOLD_MODE){
|
if ($this->mapMode == mt\MapMode::GOLD_MODE){
|
||||||
myself()->_incDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,(int)$heroDb['idx'],1);
|
myself()->_incDailyV(TN_DAILY_GOLD_MODE_BATTLE_TIMES,(int)$heroDb['idx'],1);
|
||||||
@ -306,6 +311,7 @@ class RoomBattleDataService extends BaseService {
|
|||||||
),
|
),
|
||||||
'betInfo' => array(
|
'betInfo' => array(
|
||||||
'realUser' => $this->realUserCount,
|
'realUser' => $this->realUserCount,
|
||||||
|
'ticketNum' => isset($ticketNum) ? $ticketNum : 0,
|
||||||
'coefficient' => isset($coefficient) ? $coefficient : 0,
|
'coefficient' => isset($coefficient) ? $coefficient : 0,
|
||||||
'battleScore' => round($battleScore,9),
|
'battleScore' => round($battleScore,9),
|
||||||
'teamScore' => round($teamScore,9),
|
'teamScore' => round($teamScore,9),
|
||||||
|
@ -722,7 +722,8 @@ class TameBattleDataService extends BaseService {
|
|||||||
'dead_times'=> getXVal($info,'dead_times', 0),
|
'dead_times'=> getXVal($info,'dead_times', 0),
|
||||||
'battle_score'=> 0,
|
'battle_score'=> 0,
|
||||||
'reward' => $rewards,
|
'reward' => $rewards,
|
||||||
'winningPro' => $winningPro
|
'winningPro' => $winningPro,
|
||||||
|
'match_room_uuid' => getXVal($info,'match_room_uuid', 0),
|
||||||
);
|
);
|
||||||
array_push($data['members'],$temp);
|
array_push($data['members'],$temp);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user