colly_wyx
2018-05-09 e6c0c096dc8ecefc61c4a3822750c43a1727f250
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
 
/**
 * 角色服务类
 */
 
class Service_Role extends System_Service_Base{
 
    public function __construct(){
        $this->role_model = new RoleModel();
    }
 
    /**
     * 根据条件获取角色列表
     * @param  array   $query  [description]
     * @param  array   $fields [description]
     * @param  array   $sort   [description]
     * @param  integer $limit  [description]
     * @param  integer $skip   [description]
     * @return [type]          [description]
     */
    public function getRoleList($query=array(),$fields=array(),$sort=array(),$limit=0,$skip=0){
        return $this->role_model->getList($query, $fields, $sort, $limit, $skip);
    }
 
    /**
     * 根据条件获取数量
     * @param  array   $query [description]
     * @param  integer $limit [description]
     * @param  integer $skip  [description]
     * @return [type]         [description]
     */
    public function getRoleListTotal($query=array(),$limit=0,$skip=0){
        return $this->role_model->count($query, $limit, $skip);
    }
 
    /**
     * 添加角色
     * @param [type] $data [description]
     */
    public function add($data){
        return $this->role_model->add($data);
    }
 
    /**
     * 更新角色信息
     * @param  [type] $data [description]
     * @return [type]       [description]
     */
    public function update($data, $query = array()){
        return $this->role_model->update($data, $query);
    }
 
    /**
     * 根据条件,获取角色信息
     * @param  array  $query [description]
     * @param  array  $field [description]
     * @return [type]        [description]
     */
    public function getRoleInfo($query = array(), $field = array()){
        return $this->role_model->get($query, $field);
    }
}