本文整理匯總了PHP中Model_Users::getWaiting方法的典型用法代碼示例。如果您正苦於以下問題:PHP Model_Users::getWaiting方法的具體用法?PHP Model_Users::getWaiting怎麽用?PHP Model_Users::getWaiting使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Model_Users
的用法示例。
在下文中一共展示了Model_Users::getWaiting方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: indexAction
public function indexAction()
{
if ($this->session->get('successfu_edite')) {
$this->view->successfu_edite = true;
$this->session->clear('successfu_edite');
}
if ($this->session->get('error_permision')) {
$this->view->error_permision = $this->session->get('error_permision');
$this->session->clear('error_permision');
}
$reques = $this->getRequest();
$this->view->sort = $reques->getRequest('sort', 'DESC');
$this->view->order = $reques->getRequest('order', 'u.sc_id');
$this->view->page_num = $page = $reques->getRequest('page', 1);
$this->view->filter_email = $reques->getQuery('filter_email');
$this->view->filter_sent = ($reques->getQuery('filter_sent') > -1 and $reques->getQuery('filter_sent') < 4) ? $reques->getQuery('filter_sent') : 0;
$url = '';
if ($this->view->filter_email) {
$url .= '&filter_email=' . $this->view->filter_email;
}
if ($this->view->filter_sent) {
$url .= '&filter_sent=' . $this->view->filter_sent;
}
$url1 = '';
if ($this->view->sort) {
$url1 .= '&sort=' . $this->view->sort;
}
if ($this->view->order) {
$url1 .= '&order=' . $this->view->order;
}
$url2 = '&page=' . $page;
$data = array('start' => $page * Helper_Config::get('config_admin_limit') - Helper_Config::get('config_admin_limit'), 'limit' => Helper_Config::get('config_admin_limit'), 'sort' => $this->view->sort, 'order' => $this->view->order, 'filter_email' => $this->view->filter_email, 'filter_sent' => $this->view->filter_sent);
$this->view->users = array();
$users = Model_Users::getWaiting($data);
if ($users) {
foreach ($users as $user) {
$user['date_added'] = WM_Date::format($user['date_added'], Helper_Config::get('config_date_format_long_time'));
$user['invite_href'] = $reques->getModule() . '/invites/invite/?id=' . $user['sc_id'] . $url . $url1 . $url2;
// $user['items_href'] = WM_Router::create( $this->getRequest()->getBaseUrl() . '?controller=ads&user_id=' . $user['user_id'] );
// $user['items_href'] = $reques->getModule() . '/ads/?filter_user_id=' . $user['user_id'];
$this->view->users[] = $user;
}
}
$this->view->sort = strtolower($this->view->sort);
$this->view->sort_id = $reques->getModule() . '/invites/?order=u.sc_id&sort=' . ($this->view->sort == 'asc' ? 'DESC' : 'ASC') . $url . $url2;
$this->view->sort_email = $reques->getModule() . '/invites/?order=u.email&sort=' . ($this->view->sort == 'asc' ? 'DESC' : 'ASC') . $url . $url2;
$total_records = Model_Users::getTotalWaiting($data);
$this->view->total_pages = ceil($total_records / Helper_Config::get('config_admin_limit'));
$this->view->total_rows = $total_records;
$pagination = new Model_Pagination();
$pagination->setLimit(Helper_Config::get('config_admin_limit'));
$pagination->setPage($page);
$pagination->setTotal($total_records);
$pagination->setUrl($this->getRequest()->getModule() . '/invites/?page={page}' . $url . $url1);
$this->view->pagination = $pagination->render();
}
示例2: waiting_invitationAction
public function waiting_invitationAction()
{
$data = array('start' => 0, 'limit' => 20, 'sort' => 'u.sc_id', 'order' => 'DESC', 'filter_sent' => 0);
$this->view->users = array();
$users = Model_Users::getWaiting($data);
if ($users) {
foreach ($users as $user) {
$user['date_added'] = WM_Date::format($user['date_added'], JO_Registry::get('config_date_format_long_time'));
$user['invite_href'] = $this->getRequest()->getModule() . '/invites/invite/?id=' . $user['sc_id'];
$this->view->users[] = $user;
}
}
echo $this->renderScript('json');
}