プロジェクト

全般

プロフィール

opCommunityTopicPluginTopicActions.diff

Yuma Sakata, 2012-08-13 18:14

ダウンロード (2.03 KB)

差分を表示:

lib/action/opCommunityTopicPluginTopicActions.class.php
229 229
      $this->pageUrl .= '?id='.$this->communityId;
230 230
    }
231 231

  
232
    $q = $table->getSearchQuery($request->getParameter('id'), $request->getParameter('target'), $request->getParameter('keyword'));
232
    $q = $table->getSearchQuery($request->getParameter('id'), $request->getParameter('target'), $request->getParameter('keyword'), $this->getUser()->getMemberId());
233 233
    $this->pager = $table->getResultListPager($q, $request->getParameter('page'));
234 234

  
235 235
    $this->isResult = false;
lib/model/doctrine/PluginCommunityTopicTable.class.php
82 82
    return $pager;
83 83
  }
84 84

  
85
  public function getSearchQuery($communityId = null, $target = null, $keyword = null)
85
  public function getSearchQuery($communityId = null, $target = null, $keyword = null, $memberId = null)
86 86
  {
87 87
    $q = $this->createQuery();
88 88

  
......
105 105
      }
106 106
    }
107 107

  
108
    $q->andWhereIn('community_id', opCommunityTopicToolkit::getPublicCommunityIdList())
108
    $targetCommunityIds = opCommunityTopicToolkit::getPublicCommunityIdList();
109
    if (!is_null($memberId))
110
    {
111
      $targetCommunityIds = array_merge($targetCommunityIds,
112
        Doctrine_Core::getTable('Community')->getIdsByMemberId($memberId));
113
    }
114

  
115
    $q->andWhereIn('community_id', $targetCommunityIds)
109 116
      ->orderBy('updated_at DESC');
110 117

  
111 118
    return $q;