Commit 863c5fca authored by hujun's avatar hujun

根据id检查是否有权限

parent 4a761574
...@@ -483,6 +483,26 @@ class AAgents extends BaseModel ...@@ -483,6 +483,26 @@ class AAgents extends BaseModel
->find(); ->find();
} }
/**
* 根据id检查是否有权限
*
* @param $agents_id
* @param $rule
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function agentsAuthId($agents_id, $rule) {
return $this->alias('a')
->field('b.id')
->join('auth_group b','a.auth_group_id=b.id','left')
->where('name', $rule)
->where('a.id',$agents_id)
->where('b.status',0)
->find();
}
/** /**
* 根据id获取单个字段值 * 根据id获取单个字段值
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment