Skip to content

Commit

Permalink
分类增加logo版本号
Browse files Browse the repository at this point in the history
  • Loading branch information
mousepad942 committed May 27, 2015
1 parent 5f1007e commit 2791046
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@
Wind::import('APPS:native.controller.NativeBaseController');

class ForumListController extends NativeBaseController {


protected $forums_version = array();

public function beforeAction($handlerAdapter) {
parent::beforeAction($handlerAdapter);
//
$this->loginUser = new PwUserBo($this->uid);
$this->loginUser->resetGid($this->loginUser->gid);
//获取版块的logo图片版本号
$configs = Wekit::C()->getValues('native');
$this->forums_version = isset($configs['forums.version']) && $configs['forums.version'] ? $configs['forums.version'] : array();
}


Expand Down Expand Up @@ -65,6 +70,7 @@ public function categoryListAction(){
//
foreach($categoryList as $k=>$v){
$categoryList[$k]['forums'] = $this->forumsForClass($v['fid']);
$categoryList[$k]['logo_version'] = isset($this->forums_version[$v['fid']]) ? intval($this->forums_version[$v['fid']]) : 0;
}

//
Expand Down Expand Up @@ -102,15 +108,13 @@ private function forumsForClass($fup){
$join_forum && $_fids = self::splitStringToArray($join_forum);
//
$forumList = $this->_getForumService()->getForumList();
//获取版块的logo图片版本号
$configs = Wekit::C()->getValues('native');
$forums_version = isset($configs['forums.version']) && $configs['forums.version'] ? $configs['forums.version'] : array();

foreach($forumList as $k=>$v){
if( (int)$v['fup']!=$fup ){
unset($forumList[$k]);
}else{
$forumList[$k]['isjoin'] = in_array( $v['fid'],$_fids )!==false?true:false;
$forumList[$k]['logo_version'] = isset($forums_version[$v['fid']]) ? intval($forums_version[$v['fid']]) : 0;
$forumList[$k]['logo_version'] = isset($this->forums_version[$v['fid']]) ? intval($this->forums_version[$v['fid']]) : 0;
}
}
return $forumList;
Expand Down

0 comments on commit 2791046

Please sign in to comment.