diff --git a/third_party/phpcommon b/third_party/phpcommon index daad845e..e658ed5f 160000 --- a/third_party/phpcommon +++ b/third_party/phpcommon @@ -1 +1 @@ -Subproject commit daad845e894ca033c4fdd31c9c6f39e1e4040f02 +Subproject commit e658ed5f7e4112801e59206f6da6f01db7131cd1 diff --git a/webapp/controller/EventRankingController.class.php b/webapp/controller/EventRankingController.class.php index 6d501a70..bde87534 100644 --- a/webapp/controller/EventRankingController.class.php +++ b/webapp/controller/EventRankingController.class.php @@ -123,7 +123,7 @@ class EventRankingController extends BaseAuthedController case \services\RankActivityService::GUILD_TYPE : { $rows = myself()->_getSelfMysql()->execQuery( 'SELECT guild_id,SUM(value) AS value FROM t_rank_activity ' . - 'WHERE wave=:wave AND type=:type ' . + 'WHERE wave=:wave AND type=:type AND guild_id<>""' . 'GROUP BY guild_id '. 'ORDER BY value DESC ' . "LIMIT 10", diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index af5436dd..dded111f 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -661,7 +661,9 @@ class ShopController extends BaseAuthedController { case mt\Item::HERO_TYPE: { Hero::addHero($itemMeta); + User::upsertHeadList($itemMeta); $propertyChgService->addHeroChg(); + $propertyChgService->addUserChg(); } break; case mt\Item::HERO_SKIN_TYPE: diff --git a/webapp/services/RankActivityService.php b/webapp/services/RankActivityService.php index e8010a79..f3aa0b9a 100644 --- a/webapp/services/RankActivityService.php +++ b/webapp/services/RankActivityService.php @@ -19,6 +19,7 @@ require_once('models/Battle.php'); require_once('models/Bag.php'); require_once('models/Hero.php'); require_once('models/Gun.php'); +require_once('models/Guild.php'); use mt; use phpcommon; @@ -28,6 +29,7 @@ use models\Battle; use models\Bag; use models\Hero; use models\Gun; +use models\Guild; class RankActivityService extends BaseService { @@ -103,12 +105,12 @@ class RankActivityService extends BaseService { break; case self::GUILD_TYPE : { - if ($userDb['guild_id']){ +// if ($userDb['guild_id']){ $this->internalUpdateRankActivityNew( $currentRankingMeta, $gold, $userDb); - } +// } } break; } @@ -127,6 +129,49 @@ class RankActivityService extends BaseService { if (!$meta){ return; } + if($meta['themeType'] == self::GUILD_TYPE){ + if (!$user['guild_id']){ + $row = SqlHelper::ormSelectOne + (myself()->_getSelfMysql(), + 't_rank_activity', + array( + 'account_id' => myself()->_getAccountId(), + 'wave' => $meta['wave'], + 'type' => $meta['themeType'], + ) + ); + if ($row && $row['guild_id']){ + $guild = Guild::find($row['guild_id']); + if ($guild['guild_status'] == 2){ + SqlHelper::update + (myself()->_getSelfMysql(), + 't_rank_activity', + array( + 'guild_id' => $row['guild_id'], + 'wave' => $meta['wave'], + 'type' => $meta['themeType'], + ), + array( + 'guild_id'=> '' + ) + ); + } + SqlHelper::update + (myself()->_getSelfMysql(), + 't_rank_activity', + array( + 'account_id' => myself()->_getAccountId(), + 'wave' => $meta['wave'], + 'type' => $meta['themeType'], + ), + array( + 'guild_id'=> '' + ) + ); + } + return; + } + } SqlHelper::upsert (myself()->_getSelfMysql(), 't_rank_activity', @@ -139,6 +184,7 @@ class RankActivityService extends BaseService { 'value' => function () use($val) { return "value + ${val}"; }, + 'guild_id' =>$user['guild_id'], 'modifytime' => myself()->_getNowTime(), ), array(