1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?php
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- namespace app\common\model;
-
-
- use app\common\basics\Models;
-
-
- class Role extends Models
- {
- protected $name = 'role';
-
-
-
- public function getRoleName($role_id)
- {
- $role_name = $this
- ->where(['id' => $role_id])
- ->value('name');
-
- return empty($role_name) ? '系统管理员' : $role_name;
- }
-
-
-
-
- public function getNameColumn($contidion = [])
- {
- $role_name = $this
- ->where($contidion)
- ->where('del', 0)
- ->column('name', 'id');
- return $role_name;
- }
-
-
-
-
- public function getRoleLists($where = [], $field = "*")
- {
- $where[] = ['del', '=', 0];
- return $this->where($where)->field($field)->select();
- }
-
- }
|