1
This commit is contained in:
parent
89807c6b77
commit
50a40fd6ec
@ -367,16 +367,18 @@ class Hero extends BaseModel {
|
||||
$lucky += $heroResult['lucky'];
|
||||
$lucky_rate += $heroResult['lucky_rate'];
|
||||
$chipPageDb = ChipPage::find($row['idx']);
|
||||
$data = emptyReplace(json_decode($chipPageDb['data'], true), array());
|
||||
foreach ($data as $value){
|
||||
$chipDb = Chip::find($value['chip_id']);
|
||||
if ( $chipDb ) {
|
||||
$chipAttrs = emptyReplace(json_decode($chipDb['wealth_attr'], true), array());
|
||||
$chipResult = \mt\EconomyAttribute::getAttrValue($chipAttrs);
|
||||
$wealth += $chipResult['wealth'];
|
||||
$wealth_rate += $chipResult['wealth_rate'];
|
||||
$lucky += $chipResult['lucky'];
|
||||
$lucky_rate += $chipResult['lucky_rate'];
|
||||
if ($chipPageDb){
|
||||
$data = emptyReplace(json_decode($chipPageDb['data'], true), array());
|
||||
foreach ($data as $value){
|
||||
$chipDb = Chip::find($value['chip_id']);
|
||||
if ( $chipDb ) {
|
||||
$chipAttrs = emptyReplace(json_decode($chipDb['wealth_attr'], true), array());
|
||||
$chipResult = \mt\EconomyAttribute::getAttrValue($chipAttrs);
|
||||
$wealth += $chipResult['wealth'];
|
||||
$wealth_rate += $chipResult['wealth_rate'];
|
||||
$lucky += $chipResult['lucky'];
|
||||
$lucky_rate += $chipResult['lucky_rate'];
|
||||
}
|
||||
}
|
||||
}
|
||||
return array(
|
||||
|
@ -71,34 +71,8 @@ class User extends BaseModel {
|
||||
|
||||
public static function show($row)
|
||||
{
|
||||
// mt\LevelUp::getExpByLv($row['level'],$row['exp']);
|
||||
{
|
||||
$current_star_num = $row['star_num'];
|
||||
$currSeasonMeta = \mt\StarLevel::getCurrentSeason();
|
||||
$next_star_num = mt\StarLevel::getNextNeedStarNum($current_star_num,$currSeasonMeta['id']);
|
||||
}
|
||||
$heroDb = Hero::find($row['hero_id']);
|
||||
$heroId = $heroDb['hero_id'];
|
||||
// if ($heroDb){
|
||||
// $heroId = $heroDb['hero_id'];
|
||||
// }else{
|
||||
// $heroUniId = 0;
|
||||
// $heroId = 0;
|
||||
// Hero::randHero($heroUniId,$heroId);
|
||||
// $heroMeta = mt\Item::get($heroId);
|
||||
// $headList = emptyReplace(json_decode($row['head_list'], true), array());
|
||||
// if ($heroMeta['hero_head'] && !in_array($heroMeta['hero_head'],$headList)){
|
||||
// array_push($headList,$heroMeta['hero_head']);
|
||||
// }
|
||||
// self::update(array(
|
||||
// 'hero_id' => $heroUniId,
|
||||
// 'head_id' => $heroMeta['hero_head'],
|
||||
// 'head_frame' => 60000,
|
||||
// 'head_list' => json_encode($headList),
|
||||
// 'head_frame_list' => json_encode(array(60000)),
|
||||
// ));
|
||||
// $row = myself()->_getOrmUserInfo();
|
||||
// }
|
||||
$honorInfo = array();
|
||||
if ($row['address']){
|
||||
$honorInfo = UserHonor::info($row['address']);
|
||||
@ -139,43 +113,15 @@ class User extends BaseModel {
|
||||
'parachute_list' => Parachute::getMyParachute(),
|
||||
'ring_id' => $row['ring_id'],
|
||||
'ring_list' => UserSeasonRing::ringList($row['account_id']),
|
||||
'current_star_num' => $current_star_num,
|
||||
'next_star_num' => $next_star_num,
|
||||
// 'status_bar' => self::_getState(),
|
||||
'honor_info' => $honorInfo
|
||||
);
|
||||
}
|
||||
|
||||
public static function info($row)
|
||||
{
|
||||
// mt\LevelUp::getExpByLv($row['level'],$row['exp']);
|
||||
{
|
||||
$current_star_num = $row['star_num'];
|
||||
$currSeasonMeta = \mt\StarLevel::getCurrentSeason();
|
||||
$next_star_num = mt\StarLevel::getNextNeedStarNum($current_star_num,$currSeasonMeta['id']);
|
||||
}
|
||||
|
||||
$heroDb = Hero::findByAccountId($row['account_id'],$row['hero_id']);
|
||||
$heroId = $heroDb['hero_id'];
|
||||
// if ($heroDb){
|
||||
// $heroId = $heroDb['hero_id'];
|
||||
// }else{
|
||||
// $heroUniId = 0;
|
||||
// $heroId = 0;
|
||||
// Hero::randHero($heroUniId,$heroId);
|
||||
// $heroMeta = mt\Item::get($heroId);
|
||||
// $headList = emptyReplace(json_decode($row['head_list'], true), array());
|
||||
// if ($heroMeta['hero_head'] && !in_array($heroMeta['hero_head'],$headList)){
|
||||
// array_push($headList,$heroMeta['hero_head']);
|
||||
// }
|
||||
// self::update(array(
|
||||
// 'hero_id' => $heroUniId,
|
||||
// 'head_id' => $heroMeta['hero_head'],
|
||||
// 'head_frame' => 60000,
|
||||
// 'head_list' => json_encode($headList),
|
||||
// 'head_frame_list' => json_encode(array(60000)),
|
||||
// ));
|
||||
// $row = myself()->_getOrmUserInfo();
|
||||
// }
|
||||
$honorInfo = array();
|
||||
if ($row['address']){
|
||||
$honorInfo = UserHonor::info($row['address']);
|
||||
@ -217,33 +163,13 @@ class User extends BaseModel {
|
||||
'ring_list' => UserSeasonRing::ringList($row['account_id']),
|
||||
'parachute' => $row['parachute'] ? $row['parachute'] : Parachute::$parachute,
|
||||
'parachute_list' => Parachute::getMyParachute(),
|
||||
'current_star_num' => $current_star_num,
|
||||
'next_star_num' => $next_star_num,
|
||||
// 'status_bar' => self::_getState(),
|
||||
'honor_info' => $honorInfo,
|
||||
'last_login_time' => $row['last_login_time'],
|
||||
);
|
||||
}
|
||||
|
||||
// private static function _getState(){
|
||||
// $sign_state = 0;
|
||||
// $signDb = SignLog::find();
|
||||
//// $paramMeta = \mt\Parameter::getByName('sign_daily_duration');
|
||||
//// $end_time = myself()->_getDaySeconds($signDb['createtime'])+$paramMeta['param_value']*24*60*60;
|
||||
// if($signDb['days'] == 7 && $signDb['is_receive'] == 1){
|
||||
//// if ( myself()->_getNowTime() - $end_time > 0){
|
||||
// $sign_state = 1;
|
||||
// }
|
||||
//
|
||||
// return array(
|
||||
// "first_top_up" => myself()->_getV(TN_FIRST_TUPOP_STATUS,0),
|
||||
// "sign_day" => $sign_state
|
||||
// );
|
||||
// }
|
||||
|
||||
public static function toSimple($row)
|
||||
{
|
||||
// mt\LevelUp::getExpByLv($row['level'],$row['exp']);
|
||||
$heroDb = Hero::find($row['hero_id']);
|
||||
if ($heroDb){
|
||||
$heroId = $heroDb['hero_id'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user