/** * default action 'index' * * @param Request $request * @param Response $response */ public function index(Request $request, Response $response) { $this->v->set_tplname('mod_activity_index'); if ($request->is_hashreq()) { $page_size = 5; $aList = Activity_Model::getList('created', 'DESC', $page_size); foreach ($aList as &$val) { $jNum = Activity_Model::getJoinNumByAid($val['aid'], 'join'); $val['jNum'] = intval($jNum); } $next_page = $GLOBALS['pager_currpage_arr'][0] + 1; $total_page = $GLOBALS['pager_totalpage_arr'][0]; $show_blk = ['blk_1']; //显示区域 if (isset($_GET['p'])) { $show_blk = []; } $this->v->assign('show_blk', $show_blk); $this->v->assign('total_page', $total_page)->assign('next_page', $next_page); $this->v->assign('list', $aList); } $response->send($this->v); }