public function handle_request() { $apf = APF::get_instance(); $request = $apf->get_request(); $params = $request->get_parameters(); $baseDomain = $apf->get_config('base_domain', 'common'); $baseUri = defined('BASE_URI') ? BASE_URI : ''; $showUrl = "http://my.{$baseDomain}{$baseUri}/goodbroker/show"; $win = Model_Goodbroker_Baseinfo::data_access()->filter('is_deem', 1)->filter('top_ten', 1)->limit(10)->find_all(); $gbdao = new Bll_Goodbroker(); $vcrres = $gbdao->getResourceDAO(); $winids = ''; foreach ($win as $row) { $winids .= $row->broker_id . ','; } $winids = substr($winids, 0, -1); $vcrarr = $vcrres->getVcr($winids); $varr = array(); foreach ($vcrarr as $row) { $varr[$row['broker_id']] = $row['resource_url']; } $request->set_attribute('win', $win); $request->set_attribute('varr', $varr); $request->set_attribute('showUrl', $showUrl); return 'Goodbroker_Win'; }
public function handle_request() { $apf = APF::get_instance(); $request = $apf->get_request(); $params = $request->get_parameters(); $baseDomain = $apf->get_config('base_domain', 'common'); $baseUri = defined('BASE_URI') ? BASE_URI : ''; $indexUrl = "http://my.{$baseDomain}{$baseUri}/goodbroker/index"; $showUrl = "http://my.{$baseDomain}{$baseUri}/goodbroker/show"; $guid = $request->get_guid(); $per = 16; $page = isset($params[Const_Listing::PARAM_N_PAGE]) && intval($params[Const_Listing::PARAM_N_PAGE]) > 0 ? intval($params[Const_Listing::PARAM_N_PAGE]) : 1; $daBaseinfo = Model_Goodbroker_Baseinfo::data_access()->filter('is_verify', 1); $daTotal = clone $daBaseinfo; if (time() < strtotime(date('2014-03-24'))) { $sort = isset($params['s']) ? $params['s'] : 'n'; } else { $sort = isset($params['s']) ? $params['s'] : 'h'; } if ($sort == 'n') { $Baseinfo = $daBaseinfo->limit($per)->offset(($page - 1) * $per)->sort('create_time', 'DESC')->find_all(); } else { $Baseinfo = $daBaseinfo->limit($per)->offset(($page - 1) * $per)->sort('votes', 'DESC')->find_all(); } $bllgoodbroker = new Bll_Goodbroker(); $votelog = $bllgoodbroker->getVotelog(); $brokers = ''; $votes = array(); if (!empty($Baseinfo)) { foreach ($Baseinfo as $row) { $brokers .= intval($row->broker_id) . ','; } $brokers = substr($brokers, 0, -1); $isvotes = $votelog->getVotesByUser($guid, $brokers); foreach ($isvotes as $row) { $votes[$row['broker_id']]['id'] = $row['id']; } } $total = $daTotal->count(); $pager = Util_MultiPager::multiPage($params, '', $total, $per, 5, $indexUrl); $request->set_attribute('page', $page); $request->set_attribute('pager', $pager); $request->set_attribute('showPager', $total > $per); $request->set_attribute('showUrl', $showUrl); $request->set_attribute('indexUrl', $indexUrl); $request->set_attribute('baseinfo', $Baseinfo); $request->set_attribute('votes', $votes); $request->set_attribute('sort', $sort); return 'Goodbroker_Index'; }
public function handle_request() { $apf = APF::get_instance(); $request = $apf->get_request(); $params = $request->get_parameters(); $baseDomain = $apf->get_config('base_domain', 'common'); $baseUri = defined('BASE_URI') ? BASE_URI : ''; $showUrl = "http://my.{$baseDomain}{$baseUri}/goodbroker/show"; $deemUrl = "http://my.{$baseDomain}{$baseUri}/goodbroker/deem"; $per = 16; $page = isset($params[Const_Listing::PARAM_N_PAGE]) && intval($params[Const_Listing::PARAM_N_PAGE]) > 0 ? intval($params[Const_Listing::PARAM_N_PAGE]) : 1; $daoinfo = Model_Goodbroker_Baseinfo::data_access()->filter('is_verify', 1)->filter('is_deem', 1); $daoTotal = clone $daoinfo; $Baseinfo = $daoinfo->limit($per)->offset(($page - 1) * $per)->sort('votes', 'DESC')->find_all(); $total = $daoTotal->count(); $pager = Util_MultiPager::multiPage($params, '', $total, $per, 5, $deemUrl); $request->set_attribute('page', $page); $request->set_attribute('pager', $pager); $request->set_attribute('baseinfo', $Baseinfo); $request->set_attribute('showUrl', $showUrl); $request->set_attribute('showPager', $total > $per); return 'Goodbroker_Deem'; }