/** * default action 'index' * @param Request $request * @param Response $response */ public function index(Request $request, Response $response) { // Set submenu $node_type = $request->arg(1); $node_type = ''; $this->v->assign('nav_second', $node_type); //BEGIN list order $orderinfo = $this->v->set_listorder('aid', 'desc'); $extraurl = ''; $extraurl .= $orderinfo[2]; $this->v->assign('extraurl', $extraurl); $this->v->assign('qparturl', "#/activity" . ('' != $node_type ? '/' . $node_type : '')); //END list order // Game List $limit = 20; $recordList = Activity_Model::getList($orderinfo[0], $orderinfo[1], $limit); $recordNum = count($recordList); $totalNum = $GLOBALS['pager_totalrecord_arr'][0]; $this->v->set_tplname('mod_activity_' . ($node_type ? $node_type : 'index')); $this->v->assign('recordList', $recordList)->assign('recordNum', $recordNum)->assign('totalNum', $totalNum); $response->send($this->v); }
/** * 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); }