当前位置: 首页>>代码示例>>PHP>>正文


PHP User::getUserList方法代码示例

本文整理汇总了PHP中Model\User::getUserList方法的典型用法代码示例。如果您正苦于以下问题:PHP User::getUserList方法的具体用法?PHP User::getUserList怎么用?PHP User::getUserList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Model\User的用法示例。


在下文中一共展示了User::getUserList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index()
 {
     $data['user'] = UserModel::getCurrent();
     $data['users'] = UserModel::getUserList();
     $data['planList'] = json_decode(Option::get('custom_plan_name'), true);
     Template::setContext($data);
     Template::setView('admin/user');
 }
开发者ID:sendya,项目名称:shadowsocks-panel,代码行数:8,代码来源:User.php

示例2: postAll

 /**
  * @JSON
  * @return array
  * @throws \Core\Error
  */
 public function postAll()
 {
     $subject = $_POST['mailer_subject'];
     $content = htmlspecialchars($_POST['mailer_content']);
     $content .= "<p style=\"padding: 1.5em 1em 0; color: #999; font-size: 12px;\">—— 本邮件由 " . SITE_NAME . " (<a href=\"" . BASE_URL . "\">" . BASE_URL . "</a>) 管理员发送</p>";
     if ($subject == null || $subject == '' || $content == null || $content == '') {
         return array('error' => 1, 'message' => '请求错误,您提交的参数不对。');
     }
     $users = User::getUserList();
     $mailer = Mailer1::getInstance();
     $mailer->toQueue(true);
     foreach ($users as $user) {
         $mail = new Mail();
         $params = ['nickname' => $user->nickname, 'email' => $user->email, 'useTraffic' => Utils::flowAutoShow($user->flow_up + $user->flow_down), 'transfer' => Utils::flowAutoShow($user->transfer), 'expireTime' => date('Y-m-d H:i:s', $user->expireTime), 'avatar' => true];
         $mail->subject = $subject;
         $mail->content = Utils::placeholderReplace($content, $params);
         $mail->to = $user->email;
         $mailer->send($mail);
     }
     return array('error' => 0, 'message' => '邮件列队正在工作,将在稍后开始发送..');
 }
开发者ID:sendya,项目名称:shadowsocks-panel,代码行数:26,代码来源:Mailer.php

示例3: indexAction

 public function indexAction()
 {
     $currentUrl = $this->getCurrentUrl();
     $formData = $jsonData = [];
     if ($this->request->hasPost('fsubmitbulk')) {
         $bulkid = $this->request->getPost('fbulkid', null, []);
         if (empty($bulkid)) {
             $this->flash->warning($this->lang->get('message_no_bulk_selected'));
         } else {
             $formData['fbulkid'] = $bulkid;
             if ($this->request->getPost('fbulkaction') == 'delete') {
                 $deletearr = $bulkid;
                 // Start a transaction
                 $this->db->begin();
                 $successId = [];
                 foreach ($deletearr as $deleteid) {
                     $myUser = \Model\User::findFirst(['id = :id:', 'bind' => ['id' => (int) $deleteid]])->delete();
                     // If fail stop a transaction
                     if ($myUser == false) {
                         $this->db->rollback();
                         return;
                     } else {
                         $successId[] = $deleteid;
                     }
                 }
                 // Commit a transaction
                 if ($this->db->commit() == true) {
                     $this->flash->success(str_replace('###idlist###', implode(', ', $successId), $this->lang->get('message_bulk_delete_success')));
                     $formData['fbulkid'] = null;
                 } else {
                     $this->flash->error($this->lang->get('message_bulk_delete_fail'));
                 }
             } else {
                 $this->flash->warning($this->lang->get('message_no_bulk_action'));
             }
         }
     }
     // Search keyword in specified field model
     $searchKeywordInData = ['name', 'email'];
     $page = (int) $this->request->getQuery('page', null, 1);
     $orderBy = (string) $this->request->getQuery('orderby', null, 'id');
     $orderType = (string) $this->request->getQuery('ordertype', null, 'asc');
     $keyword = (string) $this->request->getQuery('keyword', null, '');
     // optional Filter
     $id = (int) $this->request->getQuery('id', null, 0);
     $password = (string) $this->request->getQuery('password', null, '');
     $role = (int) $this->request->getQuery('role', null, 0);
     $datecreated = (int) $this->request->getQuery('datecreated', null, 0);
     $datemodified = (int) $this->request->getQuery('datemodified', null, 0);
     $formData['columns'] = '*';
     $formData['conditions'] = ['keyword' => $keyword, 'searchKeywordIn' => $searchKeywordInData, 'filterBy' => ['id' => $id, 'password' => $password, 'role' => $role, 'datecreated' => $datecreated, 'datemodified' => $datemodified]];
     $formData['orderBy'] = $orderBy;
     $formData['orderType'] = $orderType;
     $paginateUrl = $currentUrl . '?orderby=' . $formData['orderBy'] . '&ordertype=' . $formData['orderType'];
     if ($formData['conditions']['keyword'] != '') {
         $paginateUrl .= '&keyword=' . $formData['conditions']['keyword'];
     }
     $myUser = \Model\User::getUserList($formData, $this->recordPerPage, $page);
     $this->tag->prependTitle($this->lang->get('title_index'));
     $this->breadcrumb->add($this->lang->get('title_index'), 'admin/user');
     $this->breadcrumb->add('' . $this->lang->get('title_listing') . ' (' . $myUser->total_items . ')', 'admin/user');
     $this->view->setVars(['redirectUrl' => base64_encode(urlencode($currentUrl)), 'formData' => $formData, 'myUser' => $myUser, 'recordPerPage' => $this->recordPerPage, 'breadcrumb' => $this->breadcrumb->generate(), 'paginator' => $myUser, 'paginateUrl' => $paginateUrl]);
 }
开发者ID:aisuhua,项目名称:phalcon-jumpstart,代码行数:63,代码来源:UserController.php


注:本文中的Model\User::getUserList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。