| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace app\common\model;
- use think\Model;
- class User extends Model
- {
- public $page_info;
- /**
- * 用户列表
- * @access public
- * @author csdeshang
- * @param array $condition 条件
- * @param string $field 字段
- * @param number $page 分页
- * @param string $order 排序
- * @return array
- */
- public function getUserList($condition = array(), $field = '*', $page = 0, $order = 'user_id desc')
- {
- if ($page) {
- $user_list = db('user')->where($condition)->order($order)->paginate($page, false, ['query' => request()->param()]);
- $this->page_info = $user_list;
- return $user_list->items();
- } else {
- return db('user')->where($condition)->order($order)->select();
- }
- }
- /**
- * 取单个用户
- */
- public function getMemberInfo($condition, $field = '*')
- {
- return db('member')->field($field)->where($condition)->find();
- }
- }
|