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


PHP UserModel::select方法代码示例

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


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

示例1: getUsersDataTable

 public function getUsersDataTable()
 {
     $query = UserModel::select('username', 'roles', 'id')->get();
     return Datatable::collection($query)->addColumn('id', function ($model) {
         return '<a href="/users/' . $model->id . '">view</a>';
     })->searchColumns('username', 'roles')->orderColumns('username', 'roles')->make();
 }
开发者ID:shineirvin,项目名称:projectinv.github.io,代码行数:7,代码来源:AdminController.php

示例2: index

 public function index()
 {
     $usertype = Cookie::get('usertype');
     if ($usertype === 'Manager') {
         $user = new UserModel();
         $teacher = new TeacherModel();
         $course = new CourseModel();
         $school = new SchoolModel();
         $userlist = $user->select();
         $teacherlist = $teacher->select();
         $courselist = $course->select();
         $schoollist = $school->select();
         $username = Cookie::get('username');
         $usertype = Cookie::get('usertype');
         $lastlogintime = Cookie::get('lastlogintime');
         $this->assign('userlist', $userlist);
         $this->assign('teacherlist', $teacherlist);
         $this->assign('courselist', $courselist);
         $this->assign('schoollist', $schoollist);
         $this->assign('username', $username);
         $this->assign('usertype', $usertype);
         $this->assign('lastlogintime', $lastlogintime);
         $this->display();
     } elseif ($usertype === 'teacher') {
         $this->assign("jumpUrl", "__APP__/Teacher/login");
     } else {
         $this->assign("jumpUrl", "__APP__/Index/index");
         $this->success("正在转向首页");
     }
 }
开发者ID:highestgoodlikewater,项目名称:class-website,代码行数:30,代码来源:ManagerAction.class.php

示例3: getUsersDataTable

 /**
  * @return bool
  */
 public function getUsersDataTable()
 {
     $query = UserModel::select('username', 'roles', 'id')->get();
     return Datatable::collection($query)->searchColumns('username', 'roles')->orderColumns('username', 'roles')->addColumn('username', function ($model) {
         return $model->username;
     })->addColumn('roles', function ($model) {
         return $model->roles;
     })->addColumn('Actions', function ($model) {
         return "<a href='/projectinv/public/resource/" . $model->id . "' class='btn btn-success'>View</a>";
     })->make();
 }
开发者ID:shineirvin,项目名称:projectinv.github.io,代码行数:14,代码来源:UserController.php

示例4: index

 public function index($args)
 {
     //var_dump(func_get_args());
     print_r($args);
     $user = new UserModel();
     /*$user->insert('user', array(
         'username' => 'chipolata',
         'passwd'   => 'shit happens',
         'role'     => 0
       ));*/
     $user->select('uid');
     var_dump($user->get(1));
 }
开发者ID:kranack,项目名称:frmwrk,代码行数:13,代码来源:UserController.php

示例5: define

<?php

/*
后台文件
Background entry file
*/
if (!defined('ACC')) {
    define('ACC', true);
    require '../system/init.php';
}
//
$user = new UserModel();
$userlist = $user->select();
$perPage = 7;
$curPage = isset($_GET['page']) ? $_GET['page'] : 1;
$pageObj = new PaginationHelper(count($userlist), $perPage, $curPage);
$pageMenu = $pageObj->showPageMenu();
$userlist = $user->selectLimited(($curPage - 1) * $perPage, $perPage);
$userlist = $user->dataByRealDate($userlist);
include __ROOT__ . 'view/admin/templates/userlist.html';
开发者ID:qiushuiqs,项目名称:myshop,代码行数:20,代码来源:userlist.php

示例6: testDeleteAll

 public function testDeleteAll()
 {
     $table = new UserModel();
     $table->deleteAll();
     $this->assertCount(0, $table->select());
 }
开发者ID:chen8840,项目名称:LMJ-s-project,代码行数:6,代码来源:UserModelTest.php

示例7: editAction

 /**
  * 编辑
  *
  */
 public function editAction()
 {
     // 获取主键
     $id = $this->getg('id', 0);
     if (empty($id)) {
         $this->error('id 不能为空!');
     }
     // 实例化Model
     $user = new UserModel();
     // 处理Post
     if ($this->getRequest()->isPost()) {
         // 获取所有post数据
         $pdata = $this->getAllPost();
         // 处理图片等特殊数据
         // 验证
         $result = $user->validation->validate($pdata, 'edit');
         $user->parseAttributes($pdata);
         // 通过验证
         if ($result) {
             // 入库前数据处理
             // Model转换成数组
             $data = $user->toArray($pdata);
             $result = $user->update(array('id' => $id), $data);
             if ($result) {
                 // 提示信息并跳转到列表
                 Tools_help::setSession('Message', '修改成功!');
                 $this->redirect('/backend/user/index');
             } else {
                 // 出错
                 Tools_help::setSession('ErrorMessage', '修改失败, 请确定已修改了某项!');
                 $this->_view->assign("errors", $user->validation->getErrorSummary());
             }
             $user->id = $id;
         } else {
             // 验证失败
             Tools_help::setSession('ErrorMessage', '修改失败, 请检查错误项');
             $this->_view->assign("errors", $user->validation->getErrorSummary());
         }
     }
     // 如果Model数据为空,则获取
     if (!empty($id) && empty($user->id)) {
         $data = $user->select(array('where' => array('id' => $id)));
         $user->parseAttributes($data);
     }
     // 格式化表单数据
     // 模版分配数据
     $this->_view->assign("user", $user);
     $this->_view->assign("pageTitle", '修改');
 }
开发者ID:xujunjiepk,项目名称:yaf_base,代码行数:53,代码来源:User.php

示例8: UserModel

<?php

/*验证用户名*/
define('ACC', true);
require './include/init.php';
$user = new UserModel();
$rs = $user->select();
//print_r($rs);
$u = $_REQUEST['username'];
foreach ($rs as $v) {
    if ($v['username'] == $u) {
        echo '用户名已存在';
        //return false;
    }
}
//echo '用户名已存在';
开发者ID:hsian,项目名称:sinsea,代码行数:16,代码来源:AjaxUserInfo.php

示例9: getUserDic

 public function getUserDic()
 {
     return $this->userDao->select(['name', 'id']);
 }
开发者ID:loncool,项目名称:yaf-admin,代码行数:4,代码来源:Manage.php


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