12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace app\admin\model;
- use think\Model;
- class AuthGroupAccess extends Model
- {
- /**
- * 获取所属组名
- * @param $usr_id
- * @return bool|mixed
- */
- public static function getGroupName($usr_id)
- {
- $name = self::where('a.uid',$usr_id)
- ->alias('a')
- ->join(['auth_group'=>'g'],'a.group_id = g.id')
- ->field('g.name,g.id')
- ->find();
- if($name){
- return $name;
- }
- return false;
- }
- }
|