fix 一些使用问题

This commit is contained in:
maxbad
2023-05-07 14:16:46 +08:00
parent 9ac036a542
commit e8a0a41cb4
10 changed files with 24 additions and 23 deletions

View File

@@ -109,7 +109,7 @@ func setDefault(field *sysin.GenCodesColumnListModel) {
setDefaultValue(field)
if field.IsAllowNull == "YES" {
if field.IsAllowNull == "NO" {
field.Required = true
}

View File

@@ -346,6 +346,15 @@ func (s *sAdminMenu) GetMenuList(ctx context.Context, memberId int64) (lists rol
if err != nil {
return role.DynamicRes{}, err
}
if len(array) > 0 {
pidList, err := dao.AdminMenu.Ctx(ctx).Fields("pid").WhereIn("id", array).Group("pid").Array()
if err != nil {
return role.DynamicRes{}, err
}
if len(pidList) > 0 {
array = append(pidList, array...)
}
}
mod = mod.Where("id", array)
}

View File

@@ -99,7 +99,7 @@ func (s *sSysLog) Export(ctx context.Context, in sysin.LogListInp) (err error) {
// RealWrite 真实写入
func (s *sSysLog) RealWrite(ctx context.Context, commonLog entity.SysLog) (err error) {
_, err = dao.SysLog.Ctx(ctx).Data(commonLog).Insert()
_, err = dao.SysLog.Ctx(ctx).Data(commonLog).FieldsEx(dao.SysLog.Columns().Id).Insert()
return
}

View File

@@ -99,7 +99,7 @@ func (s *sSysLoginLog) List(ctx context.Context, in sysin.LoginLogListInp) (list
}
for _, v := range list {
g.DumpWithType(v)
//g.DumpWithType(v)
//// 获取省市编码对应的地区名称
//region, err := location.ParseRegion(ctx, v.SysLogProvinceId, v.SysLogCityId, 0)
//if err != nil {
@@ -191,6 +191,6 @@ func (s *sSysLoginLog) Push(ctx context.Context, in sysin.LoginLogPushInp) {
// RealWrite 真实写入
func (s *sSysLoginLog) RealWrite(ctx context.Context, models entity.SysLoginLog) (err error) {
_, err = dao.SysLoginLog.Ctx(ctx).Data(models).Insert()
_, err = dao.SysLoginLog.Ctx(ctx).Data(models).FieldsEx(dao.SysLoginLog.Columns().Id).Insert()
return
}

View File

@@ -144,6 +144,6 @@ func (s *sSysServeLog) View(ctx context.Context, in sysin.ServeLogViewInp) (res
// RealWrite 真实写入
func (s *sSysServeLog) RealWrite(ctx context.Context, models entity.SysServeLog) (err error) {
_, err = dao.SysServeLog.Ctx(ctx).Data(models).Insert()
_, err = dao.SysServeLog.Ctx(ctx).Data(models).FieldsEx(dao.SysServeLog.Columns().Id).Insert()
return
}