mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-07 18:50:26 +08:00
更新SQL
This commit is contained in:
@@ -63,6 +63,19 @@ func (this *AdminDAO) FindEnabledAdmin(tx *dbs.Tx, id int64) (*Admin, error) {
|
|||||||
return result.(*Admin), err
|
return result.(*Admin), err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FindBasicAdmin 查找管理员基本信息
|
||||||
|
func (this *AdminDAO) FindBasicAdmin(tx *dbs.Tx, id int64) (*Admin, error) {
|
||||||
|
result, err := this.Query(tx).
|
||||||
|
Result("id", "username", "fullname").
|
||||||
|
Pk(id).
|
||||||
|
Attr("state", AdminStateEnabled).
|
||||||
|
Find()
|
||||||
|
if result == nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return result.(*Admin), err
|
||||||
|
}
|
||||||
|
|
||||||
// ExistEnabledAdmin 检查管理员是否存在
|
// ExistEnabledAdmin 检查管理员是否存在
|
||||||
func (this *AdminDAO) ExistEnabledAdmin(tx *dbs.Tx, adminId int64) (bool, error) {
|
func (this *AdminDAO) ExistEnabledAdmin(tx *dbs.Tx, adminId int64) (bool, error) {
|
||||||
return this.Query(tx).
|
return this.Query(tx).
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user