| <?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); | 
|     } | 
| } |