Browse Source

update

add_mode
DengBiao 1 year ago
parent
commit
e3d17a0f4c
33 changed files with 211 additions and 245 deletions
  1. +15
    -15
      app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go
  2. +3
    -3
      app/admin/hdl/hdl_banner.go
  3. +16
    -8
      app/admin/hdl/hdl_comm.go
  4. +3
    -3
      app/admin/hdl/hdl_company.go
  5. +11
    -11
      app/admin/hdl/hdl_enterprise.go
  6. +3
    -3
      app/admin/hdl/hdl_notice.go
  7. +21
    -10
      app/admin/hdl/hdl_role.go
  8. +1
    -0
      app/admin/md/md_enterprise_manage.go
  9. +1
    -0
      app/admin/md/md_role.go
  10. +2
    -2
      app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go
  11. +5
    -3
      app/admin/svc/enterprise_manage/svc_enterprise_manage.go
  12. +1
    -1
      app/admin/svc/order/svc_central_kitchen_for_school_order.go
  13. +4
    -4
      app/admin/svc/svc_role.go
  14. +1
    -1
      app/admin/svc/svc_user.go
  15. +3
    -3
      app/customer/hdl/hdl_login.go
  16. +3
    -3
      app/customer/svc/order/svc_central_kitchen_for_school_order.go
  17. +2
    -2
      app/customer/svc/svc_auth.go
  18. +3
    -1
      app/db/db_user_identity.go
  19. +6
    -10
      app/db/model/admin_role.go
  20. +6
    -10
      app/db/model/banner.go
  21. +8
    -12
      app/db/model/central_kitchen_for_school_set.go
  22. +11
    -15
      app/db/model/central_kitchen_for_school_user_refund_day.go
  23. +13
    -17
      app/db/model/central_kitchen_for_school_with_spec.go
  24. +7
    -11
      app/db/model/class.go
  25. +8
    -12
      app/db/model/company.go
  26. +9
    -13
      app/db/model/enterprise.go
  27. +6
    -10
      app/db/model/grade.go
  28. +6
    -10
      app/db/model/notice.go
  29. +7
    -10
      app/db/model/permission_group.go
  30. +5
    -9
      app/db/model/permission_group_permission.go
  31. +5
    -9
      app/db/model/role_permission_group.go
  32. +8
    -12
      app/db/model/self_support_for_school_info.go
  33. +8
    -12
      app/db/model/user.go

+ 15
- 15
app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go View File

@@ -334,8 +334,8 @@ func SetCentralKitchenForSchoolWithSpec(c *gin.Context) {
BreakfastUnitPriceForTeacher: req.BreakfastUnitPriceForTeacher,
LunchUnitPriceForTeacher: req.LunchUnitPriceForTeacher,
DinnerUnitPriceForTeacher: req.DinnerUnitPriceForTeacher,
CreateAt: now,
UpdateAt: now,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
})
if err1 != nil {
e.OutErr(c, e.ERR_DB_ORM, err1.Error())
@@ -354,8 +354,8 @@ func SetCentralKitchenForSchoolWithSpec(c *gin.Context) {
BreakfastUnitPriceForTeacher: req.BreakfastUnitPriceForTeacher,
LunchUnitPriceForTeacher: req.LunchUnitPriceForTeacher,
DinnerUnitPriceForTeacher: req.DinnerUnitPriceForTeacher,
CreateAt: now,
UpdateAt: now,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
})
if err1 != nil {
e.OutErr(c, e.ERR_DB_ORM, err1.Error())
@@ -509,7 +509,7 @@ func SetBasicCentralKitchenForSchool(c *gin.Context) {
set.IsOpenReportMealForDay = req.IsOpenReportMealForDay
set.IsOpenReportMealForMonth = req.IsOpenReportMealForMonth
set.IsOpenReportMealForSemester = req.IsOpenReportMealForSemester
set.UpdateAt = now
set.UpdateAt = now.Format("2006-01-02 15:04:05")
_, err2 := centralKitchenForSchoolSetDb.CentralKitchenForSchoolSetUpdate(set.Id, set, "is_open_teacher_report_meal", "is_open_report_meal_for_day", "is_open_report_meal_for_month", "is_open_report_meal_for_semester", "update_at")
if err2 != nil {
e.OutErr(c, e.ERR_DB_ORM, err2.Error())
@@ -522,8 +522,8 @@ func SetBasicCentralKitchenForSchool(c *gin.Context) {
IsOpenReportMealForDay: req.IsOpenReportMealForDay,
IsOpenReportMealForMonth: req.IsOpenReportMealForMonth,
IsOpenReportMealForSemester: req.IsOpenReportMealForSemester,
CreateAt: now,
UpdateAt: now,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
})
if err2 != nil {
e.OutErr(c, e.ERR_DB_ORM, err2.Error())
@@ -543,7 +543,7 @@ func SetBasicCentralKitchenForSchool(c *gin.Context) {
spec.IsOpenBreakfast = req.IsOpenBreakfast
spec.IsOpenLunch = req.IsOpenLunch
spec.IsOpenDinner = req.IsOpenDinner
spec.UpdateAt = now
spec.UpdateAt = now.Format("2006-01-02 15:04:05")
_, err2 := centralKitchenForSchoolWithSpec.CentralKitchenForSchoolWithSpecUpdate(spec.Id, spec, "is_open_breakfast", "is_open_lunch", "is_open_dinner", "update_at")
if err2 != nil {
e.OutErr(c, e.ERR_DB_ORM, err2.Error())
@@ -555,8 +555,8 @@ func SetBasicCentralKitchenForSchool(c *gin.Context) {
IsOpenBreakfast: req.IsOpenBreakfast,
IsOpenLunch: req.IsOpenLunch,
IsOpenDinner: req.IsOpenDinner,
CreateAt: now,
UpdateAt: now,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
})
if err2 != nil {
e.OutErr(c, e.ERR_DB_ORM, err2.Error())
@@ -578,7 +578,7 @@ func SetBasicCentralKitchenForSchool(c *gin.Context) {
}
enterprise.Name = req.Name
enterprise.State = req.State
enterprise.UpdateAt = now
enterprise.UpdateAt = now.Format("2006-01-02 15:04:05")
_, err = enterpriseDb.EnterpriseUpdate(enterprise, "name", "state", "update_at")
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
@@ -607,8 +607,8 @@ func GetBasicCentralKitchenForSchool(c *gin.Context) {
IsOpenReportMealForDay: 0,
IsOpenReportMealForMonth: 0,
IsOpenReportMealForSemester: 0,
CreateAt: time.Time{},
UpdateAt: time.Time{},
CreateAt: time.Time{}.Format("2006-01-02 15:04:05"),
UpdateAt: time.Time{}.Format("2006-01-02 15:04:05"),
}
_, err2 := centralKitchenForSchoolSetDb.CentralKitchenForSchoolSetInsert(set)
if err2 != nil {
@@ -637,8 +637,8 @@ func GetBasicCentralKitchenForSchool(c *gin.Context) {
BreakfastUnitPriceForTeacher: "0",
LunchUnitPriceForTeacher: "0",
DinnerUnitPriceForTeacher: "0",
CreateAt: time.Time{},
UpdateAt: time.Time{},
CreateAt: time.Time{}.Format("2006-01-02 15:04:05"),
UpdateAt: time.Time{}.Format("2006-01-02 15:04:05"),
}
_, err2 := centralKitchenForSchoolWithSpec.CentralKitchenForSchoolWithSpecInsert(spec)
if err2 != nil {


+ 3
- 3
app/admin/hdl/hdl_banner.go View File

@@ -66,8 +66,8 @@ func BannerAdd(c *gin.Context) {
banner := model.Banner{
Name: req.Name,
ImgUrl: req.ImgUrl,
CreateAt: now,
UpdateAt: now,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
}
_, err = bannerDb.BannerInsert(&banner)
if err != nil {
@@ -101,7 +101,7 @@ func BannerUpdate(c *gin.Context) {
now := time.Now()
banner.Name = req.Name
banner.ImgUrl = req.ImgUrl
banner.UpdateAt = now
banner.UpdateAt = now.Format("2006-01-02 15:04:05")
_, err = bannerDb.BannerUpdate(banner, "name", "content", "update_at")
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())


+ 16
- 8
app/admin/hdl/hdl_comm.go View File

@@ -33,9 +33,9 @@ func MenuList(c *gin.Context) {
roleDb.Set(0)
var adminHasPermissionGroupIds []string
for _, v := range *roles {
list, _, err := roleDb.FindPermissionGroupByRole(v.RoleId)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
list, _, err1 := roleDb.FindPermissionGroupByRole(v.RoleId)
if err1 != nil {
e.OutErr(c, e.ERR_DB_ORM, err1.Error())
return
}
for _, v1 := range list {
@@ -53,23 +53,31 @@ func MenuList(c *gin.Context) {
tempRespMap[utils.IntToStr(v.Id)] = &md.PermissionGroupListResp{
Id: v.Id,
Name: v.Name,
Key: v.Key,
State: v.State,
ParentId: v.ParentId,
CreateAt: v.CreateAt.Format("2006-01-02 15:04:05"),
UpdateAt: v.UpdateAt.Format("2006-01-02 15:04:05"),
CreateAt: v.CreateAt,
UpdateAt: v.UpdateAt,
IsCheck: isCheck,
}
tempRespMapKeys = append(tempRespMapKeys, utils.IntToStr(v.Id))
}
for _, v := range tempRespMap {
if v.ParentId != 0 {
if v.ParentId != 0 && tempRespMap[utils.IntToStr(v.ParentId)].ParentId != 0 {
tempRespMap[utils.IntToStr(v.ParentId)].SubPermissionGroupList = append(tempRespMap[utils.IntToStr(v.ParentId)].SubPermissionGroupList, *v)
}
}
for _, v := range tempRespMap {
if v.ParentId != 0 && tempRespMap[utils.IntToStr(v.ParentId)].ParentId == 0 {
tempRespMap[utils.IntToStr(v.ParentId)].SubPermissionGroupList = append(tempRespMap[utils.IntToStr(v.ParentId)].SubPermissionGroupList, *v)
}
}

var resp []md.PermissionGroupListResp
var resp []*md.PermissionGroupListResp
for _, v := range tempRespMapKeys {
resp = append(resp, *tempRespMap[v])
if tempRespMap[v].ParentId == 0 {
resp = append(resp, tempRespMap[v])
}
}

e.OutSuc(c, map[string]interface{}{


+ 3
- 3
app/admin/hdl/hdl_company.go View File

@@ -54,8 +54,8 @@ func CompanyAdd(c *gin.Context) {
Memo: req.Memo,
LeadName: req.LeadName,
LeadPhone: req.LeadPhone,
CreateAt: now,
UpdateAt: now,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
}
_, err = companyDb.CompanyInsert(&company)
if err != nil {
@@ -93,7 +93,7 @@ func CompanyUpdate(c *gin.Context) {
if req.State != 0 {
company.State = req.State
}
company.UpdateAt = now
company.UpdateAt = now.Format("2006-01-02 15:04:05")
_, err = companyDb.CompanyUpdate(company, "name", "memo", "state", "lead_name", "lead_phone", "update_at")
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())


+ 11
- 11
app/admin/hdl/hdl_enterprise.go View File

@@ -134,8 +134,8 @@ func EnterpriseAdd(c *gin.Context) {
CompanyId: req.CompanyId,
State: enum2.CompanyStateForNormal,
Memo: req.Memo,
CreateAt: now,
UpdateAt: now,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
}
_, err = enterpriseDb.EnterpriseInsert(&enterprise)
if err != nil {
@@ -197,7 +197,7 @@ func EnterpriseUpdate(c *gin.Context) {
enterprise.Pvd = int32(pvd)
enterprise.Kind = req.Kind
enterprise.CompanyId = req.CompanyId
enterprise.UpdateAt = now
enterprise.UpdateAt = now.Format("2006-01-02 15:04:05")
_, err = enterpriseDb.EnterpriseUpdate(enterprise, "name", "memo", "pvd", "kind", "company_id", "update_at")
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
@@ -232,8 +232,8 @@ func EnterpriseUpdate(c *gin.Context) {
EnterpriseId: req.Id,
Name: v.Name,
Memo: "",
CreateAt: now,
UpdateAt: now,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
})
if err1 != nil {
e.OutErr(c, e.ERR_DB_ORM, err1.Error())
@@ -245,8 +245,8 @@ func EnterpriseUpdate(c *gin.Context) {
Memo: "",
GradeId: insertId,
EnterpriseId: req.Id,
CreateAt: now,
UpdateAt: now,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
})
}

@@ -277,8 +277,8 @@ func EnterpriseUpdate(c *gin.Context) {
Memo: "",
GradeId: grade.Id,
EnterpriseId: req.Id,
CreateAt: now,
UpdateAt: now,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
})
} else {
//编辑
@@ -336,7 +336,7 @@ func EnterpriseAddGrade(c *gin.Context) {
}
now := time.Now()
enterprise.State = req.State
enterprise.UpdateAt = now
enterprise.UpdateAt = now.Format("2006-01-02 15:04:05")
_, err = enterpriseDb.EnterpriseUpdate(enterprise, "state", "update_at")
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
@@ -368,7 +368,7 @@ func EnterpriseUpdateState(c *gin.Context) {
}
now := time.Now()
enterprise.State = req.State
enterprise.UpdateAt = now
enterprise.UpdateAt = now.Format("2006-01-02 15:04:05")
_, err = enterpriseDb.EnterpriseUpdate(enterprise, "state", "update_at")
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())


+ 3
- 3
app/admin/hdl/hdl_notice.go View File

@@ -66,8 +66,8 @@ func NoticeAdd(c *gin.Context) {
notice := model.Notice{
Name: req.Name,
Content: req.Content,
CreateAt: now,
UpdateAt: now,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
}
_, err = noticeDb.NoticeInsert(&notice)
if err != nil {
@@ -101,7 +101,7 @@ func NoticeUpdate(c *gin.Context) {
now := time.Now()
notice.Name = req.Name
notice.Content = req.Content
notice.UpdateAt = now
notice.UpdateAt = now.Format("2006-01-02 15:04:05")
_, err = noticeDb.NoticeUpdate(notice, "name", "content", "update_at")
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())


+ 21
- 10
app/admin/hdl/hdl_role.go View File

@@ -35,29 +35,40 @@ func PermissionGroupList(c *gin.Context) {
isHasPermissionGroupId = append(isHasPermissionGroupId, utils.IntToStr(v.PermissionGroup.Id))
}

var tempResp = map[string]*md.PermissionGroupListResp{}
var tempRespMap = map[string]*md.PermissionGroupListResp{}
var tempRespMapKeys []string
for _, v := range *groupList {
isCheck := false
if utils.InArr(utils.IntToStr(v.Id), isHasPermissionGroupId) {
isCheck = true
}
tempResp[utils.IntToStr(v.Id)] = &md.PermissionGroupListResp{
tempRespMap[utils.IntToStr(v.Id)] = &md.PermissionGroupListResp{
Id: v.Id,
Name: v.Name,
Key: v.Key,
State: v.State,
ParentId: v.ParentId,
CreateAt: v.CreateAt.Format("2006-01-02 15:04:05"),
UpdateAt: v.UpdateAt.Format("2006-01-02 15:04:05"),
CreateAt: v.CreateAt,
UpdateAt: v.UpdateAt,
IsCheck: isCheck,
}
tempRespMapKeys = append(tempRespMapKeys, utils.IntToStr(v.Id))
}
for _, v := range tempRespMap {
if v.ParentId != 0 && tempRespMap[utils.IntToStr(v.ParentId)].ParentId != 0 {
tempRespMap[utils.IntToStr(v.ParentId)].SubPermissionGroupList = append(tempRespMap[utils.IntToStr(v.ParentId)].SubPermissionGroupList, *v)
}
}
for _, v := range tempRespMap {
if v.ParentId != 0 && tempRespMap[utils.IntToStr(v.ParentId)].ParentId == 0 {
tempRespMap[utils.IntToStr(v.ParentId)].SubPermissionGroupList = append(tempRespMap[utils.IntToStr(v.ParentId)].SubPermissionGroupList, *v)
}
}

var resp []md.PermissionGroupListResp
for _, v := range tempResp {
if v.ParentId != 0 {
tempResp[utils.IntToStr(v.ParentId)].SubPermissionGroupList = append(tempResp[utils.IntToStr(v.ParentId)].SubPermissionGroupList, *v)
} else {
resp = append(resp, *v)
var resp []*md.PermissionGroupListResp
for _, v := range tempRespMapKeys {
if tempRespMap[v].ParentId == 0 {
resp = append(resp, tempRespMap[v])
}
}



+ 1
- 0
app/admin/md/md_enterprise_manage.go View File

@@ -17,6 +17,7 @@ type EnterpriseUserListByCentralKitchenForSchoolStruct struct {
IsTeacher int `json:"is_teacher" label:"是否教师"`
CreateAt string `json:"create_at" label:"创建时间"`
UserIdentities []struct {
Id int `json:"id" label:"身份id"`
IdNo string `json:"id_no" label:"身份证号"`
SchoolName string `json:"school_name" label:"学校名"`
Name string `json:"name" label:"姓名"`


+ 1
- 0
app/admin/md/md_role.go View File

@@ -35,6 +35,7 @@ type RoleBindPermissionGroupReq struct {
type PermissionGroupListResp struct {
Id int `json:"id"`
Name string `json:"name"`
Key string `json:"key"`
State int `json:"state"`
ParentId int `json:"parent_id"`
CreateAt string `json:"create_at"`


+ 2
- 2
app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go View File

@@ -506,8 +506,8 @@ func CentralKitchenForSchoolOrdRefund(req md.CentralKitchenForSchoolOrdRefundReq
State: enum2.CentralKitchenForSchoolUserRefundDayStateForAuditing,
Amount: v.Amount,
Memo: "",
CreateAt: now,
UpdateAt: now,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
})
}



+ 5
- 3
app/admin/svc/enterprise_manage/svc_enterprise_manage.go View File

@@ -61,13 +61,14 @@ func EnterpriseUserListByCentralKitchenForSchool(req md.EnterpriseUserListReq) (
Phone: v.Phone,
Avatar: v.Avatar,
IsTeacher: 0,
CreateAt: v.CreateAt.Format("2006-01-02 15:04:05"),
CreateAt: v.CreateAt,
}
for _, v1 := range userIdentitiesMap[utils.IntToStr(v.Id)] {
fmt.Println(">>>>>>>>>>>>", userIdentitiesMap[utils.IntToStr(v.Id)])
//TODO::判断是否为老师
if v1.Identity == enum2.UserIdentityForCentralKitchenForTeacher {
temp.UserIdentities = append(temp.UserIdentities, struct {
Id int `json:"id" label:"身份id"`
IdNo string `json:"id_no" label:"身份证号"`
SchoolName string `json:"school_name" label:"学校名"`
Name string `json:"name" label:"姓名"`
@@ -75,7 +76,7 @@ func EnterpriseUserListByCentralKitchenForSchool(req md.EnterpriseUserListReq) (
GradeId int `json:"grade_id" label:"年级id"`
Class string `json:"class" label:"班级"`
ClassId int `json:"class_id" label:"班级id"`
}{IdNo: v1.IdNo, SchoolName: "教师", Name: v1.Name, Grade: "教师", Class: "教师", GradeId: 0, ClassId: 0})
}{Id: v1.Id, IdNo: v1.IdNo, SchoolName: "教师", Name: v1.Name, Grade: "教师", Class: "教师", GradeId: 0, ClassId: 0})
temp.IsTeacher = 1
} else {
data, err2 := classWithUserDb.GetInfoByUserIdentityId(v1.Id)
@@ -86,6 +87,7 @@ func EnterpriseUserListByCentralKitchenForSchool(req md.EnterpriseUserListReq) (
continue
}
temp.UserIdentities = append(temp.UserIdentities, struct {
Id int `json:"id" label:"身份id"`
IdNo string `json:"id_no" label:"身份证号"`
SchoolName string `json:"school_name" label:"学校名"`
Name string `json:"name" label:"姓名"`
@@ -93,7 +95,7 @@ func EnterpriseUserListByCentralKitchenForSchool(req md.EnterpriseUserListReq) (
GradeId int `json:"grade_id" label:"年级id"`
Class string `json:"class" label:"班级"`
ClassId int `json:"class_id" label:"班级id"`
}{IdNo: data.UserIdentity.IdNo, SchoolName: data.Enterprise.Name, Name: data.UserIdentity.Name, Grade: data.Grade.Name, Class: data.Class.Name, GradeId: data.Grade.Id, ClassId: data.Class.Id})
}{Id: v1.Id, IdNo: data.UserIdentity.IdNo, SchoolName: data.Enterprise.Name, Name: data.UserIdentity.Name, Grade: data.Grade.Name, Class: data.Class.Name, GradeId: data.Grade.Id, ClassId: data.Class.Id})
}
}
resp.List = append(resp.List, temp)


+ 1
- 1
app/admin/svc/order/svc_central_kitchen_for_school_order.go View File

@@ -108,7 +108,7 @@ func CentralKitchenForSchoolOrderRefundList(req md.CentralKitchenForSchoolOrderR
Kind: v.CentralKitchenForSchoolUserWithDay.Kind,
Amount: v.CentralKitchenForSchoolUserRefundDay.Amount,
State: v.CentralKitchenForSchoolUserRefundDay.State,
CreateAt: v.CentralKitchenForSchoolUserRefundDay.CreateAt.Format("2006-01-02 15:04:05"),
CreateAt: v.CentralKitchenForSchoolUserRefundDay.CreateAt,
Memo: v.CentralKitchenForSchoolUserRefundDay.Memo,
})
}


+ 4
- 4
app/admin/svc/svc_role.go View File

@@ -132,8 +132,8 @@ func RoleBindPermissionGroup(req md.RoleBindPermissionGroupReq) (err error) {
mm = append(mm, &model.RolePermissionGroup{
RoleId: role.Id,
GroupId: v,
CreateAt: now,
UpdateAt: now,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
})
}
_, err = rolePermissionGroupDb.BatchAddRolePermissionGroupBySession(session, mm)
@@ -177,8 +177,8 @@ func BindAdminRole(req md.BindAdminRoleReq) (err error) {
AdmId: req.AdmId,
RoleId: v,
State: 1,
CreateAt: now,
UpdateAt: now,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
})
}
_, err = adminRoleDb.BatchAddAdminRoleBySession(session, mm)


+ 1
- 1
app/admin/svc/svc_user.go View File

@@ -45,7 +45,7 @@ func UserList(req md.UserListReq) (resp md.UserListResp, err error) {
Nickname: v.Nickname,
Phone: v.Phone,
Avatar: v.Avatar,
CreateAt: v.CreateAt.Format("2006-01-02 15:04:05"),
CreateAt: v.CreateAt,
}
for _, v1 := range *identity {
temp.BindUserIdentity = append(temp.BindUserIdentity, struct {


+ 3
- 3
app/customer/hdl/hdl_login.go View File

@@ -72,8 +72,8 @@ func Register(c *gin.Context) {
Avatar: req.Avatar,
Phone: req.Phone,
Memo: "",
CreateAt: now,
UpdateAt: now,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
}
insertAffected, err1 := userDb.UserInsert(user)
if err1 != nil {
@@ -92,7 +92,7 @@ func Register(c *gin.Context) {
if req.Avatar != "" {
user.Avatar = req.Avatar
}
user.UpdateAt = now
user.UpdateAt = now.Format("2006-01-02 15:04:05")
updateAffected, err1 := userDb.UpdateUser(user, "user_id", "nickname", "avatar", "update_at")
if err1 != nil {
e.OutErr(c, e.ERR_DB_ORM, err1)


+ 3
- 3
app/customer/svc/order/svc_central_kitchen_for_school_order.go View File

@@ -88,8 +88,8 @@ func CentralKitchenForSchoolOrderRefund(req md.CentralKitchenForSchoolOrderRefun
State: enum.CentralKitchenForSchoolUserRefundDayStateForAuditing,
Amount: centralKitchenForSchoolUserWithDay.Amount,
Memo: "",
CreateAt: now,
UpdateAt: now,
CreateAt: now.Format("2006-01-02 15:04:05"),
UpdateAt: now.Format("2006-01-02 15:04:05"),
})
return
}
@@ -109,7 +109,7 @@ func CentralKitchenForSchoolOrderRefundList(req md.CentralKitchenForSchoolOrderR
OutTradeNo: v.CentralKitchenForSchoolUserRefundDay.OutTradeNo,
OutRequestNo: v.CentralKitchenForSchoolUserRefundDay.OutRequestNo,
Kind: v.CentralKitchenForSchoolUserWithDay.Kind,
CreateAt: v.CentralKitchenForSchoolUserRefundDay.CreateAt.Format("2006-01-02 15:04:05"),
CreateAt: v.CentralKitchenForSchoolUserRefundDay.CreateAt,
Date: v.CentralKitchenForSchoolUserWithDay.Date,
State: v.CentralKitchenForSchoolUserRefundDay.State,
Memo: v.CentralKitchenForSchoolUserRefundDay.Memo,


+ 2
- 2
app/customer/svc/svc_auth.go View File

@@ -20,8 +20,8 @@ func GetUser(c *gin.Context) *model.User {
Avatar: "",
Phone: "",
Memo: "",
CreateAt: time.Time{},
UpdateAt: time.Time{},
CreateAt: time.Time{}.Format("2006-01-02 15:04:05"),
UpdateAt: time.Time{}.Format("2006-01-02 15:04:05"),
}
}
return user.(*model.User)


+ 3
- 1
app/db/db_user_identity.go View File

@@ -2,6 +2,7 @@ package db

import (
"applet/app/db/model"
"applet/app/enum"
"applet/app/utils/logx"
"reflect"
"xorm.io/xorm"
@@ -45,7 +46,8 @@ func (userIdentityDb *UserIdentityDb) FindUserIdentity() (*[]UserIdentityWithEnt
var m []UserIdentityWithEnterprise
if err := userIdentityDb.Db.
Join("LEFT", "enterprise", "user_identity.enterprise_id = enterprise.id").
Where("user_identity.uid =?", userIdentityDb.Uid).Desc("user_identity.id").Find(&m); err != nil {
Where("user_identity.state =?", enum.UserIdentityStateForNormal).
And("user_identity.uid =?", userIdentityDb.Uid).Desc("user_identity.id").Find(&m); err != nil {
return nil, logx.Error(err)
}
return &m, nil


+ 6
- 10
app/db/model/admin_role.go View File

@@ -1,14 +1,10 @@
package model

import (
"time"
)

type AdminRole struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
AdmId int `json:"adm_id" xorm:"not null default 0 comment('管理员id') INT(11)"`
RoleId int `json:"role_id" xorm:"not null default 0 comment('角色id') INT(11)"`
State int `json:"state" xorm:"not null default 1 comment('状态(1:正常 2:冻结)') TINYINT(1)"`
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
AdmId int `json:"adm_id" xorm:"not null default 0 comment('管理员id') INT(11)"`
RoleId int `json:"role_id" xorm:"not null default 0 comment('角色id') INT(11)"`
State int `json:"state" xorm:"not null default 1 comment('状态(1:正常 2:冻结)') TINYINT(1)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

+ 6
- 10
app/db/model/banner.go View File

@@ -1,14 +1,10 @@
package model

import (
"time"
)

type Banner struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Name string `json:"name" xorm:"not null default '' comment('名称') VARCHAR(255)"`
ImgUrl string `json:"img_url" xorm:"not null default '' comment('轮播图url') VARCHAR(255)"`
Sort int `json:"sort" xorm:"not null default 0 comment('排序') TINYINT(3)"`
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Name string `json:"name" xorm:"not null default '' comment('名称') VARCHAR(255)"`
ImgUrl string `json:"img_url" xorm:"not null default '' comment('轮播图url') VARCHAR(255)"`
Sort int `json:"sort" xorm:"not null default 0 comment('排序') TINYINT(3)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

+ 8
- 12
app/db/model/central_kitchen_for_school_set.go View File

@@ -1,16 +1,12 @@
package model

import (
"time"
)

type CentralKitchenForSchoolSet struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
EnterpriseId int `json:"enterprise_id" xorm:"not null default 0 comment('所属单位id') INT(11)"`
IsOpenTeacherReportMeal int `json:"is_open_teacher_report_meal" xorm:"not null default 1 comment('教师报餐(1:开启 2:关闭)') TINYINT(1)"`
IsOpenReportMealForDay int `json:"is_open_report_meal_for_day" xorm:"not null default 1 comment('开启按天报餐(1:开启 2:关闭)') TINYINT(1)"`
IsOpenReportMealForMonth int `json:"is_open_report_meal_for_month" xorm:"not null default 1 comment('开启按月报餐(1:开启 2:关闭)') TINYINT(1)"`
IsOpenReportMealForSemester int `json:"is_open_report_meal_for_semester" xorm:"not null default 1 comment('开启按学期报餐(1:开启 2:关闭)') TINYINT(1)"`
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
EnterpriseId int `json:"enterprise_id" xorm:"not null default 0 comment('所属单位id') INT(11)"`
IsOpenTeacherReportMeal int `json:"is_open_teacher_report_meal" xorm:"not null default 1 comment('教师报餐(1:开启 2:关闭)') TINYINT(1)"`
IsOpenReportMealForDay int `json:"is_open_report_meal_for_day" xorm:"not null default 1 comment('开启按天报餐(1:开启 2:关闭)') TINYINT(1)"`
IsOpenReportMealForMonth int `json:"is_open_report_meal_for_month" xorm:"not null default 1 comment('开启按月报餐(1:开启 2:关闭)') TINYINT(1)"`
IsOpenReportMealForSemester int `json:"is_open_report_meal_for_semester" xorm:"not null default 1 comment('开启按学期报餐(1:开启 2:关闭)') TINYINT(1)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

+ 11
- 15
app/db/model/central_kitchen_for_school_user_refund_day.go View File

@@ -1,19 +1,15 @@
package model

import (
"time"
)

type CentralKitchenForSchoolUserRefundDay struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
OutTradeNo string `json:"out_trade_no" xorm:"default '' comment('订单号') VARCHAR(50)"`
OutRequestNo string `json:"out_request_no" xorm:"not null default '' comment('退款请求号') VARCHAR(50)"`
Uid int `json:"uid" xorm:"not null default 0 comment('uid') INT(11)"`
IdentityId int `json:"identity_id" xorm:"not null default 0 comment('身份id') INT(11)"`
RecordsId int `json:"records_id" xorm:"not null default 0 comment('记录id') INT(11)"`
State int `json:"state" xorm:"not null default 1 comment('状态(1:审核中 2:审核通过 3:审核拒绝 4:退款已完成)') TINYINT(1)"`
Amount string `json:"amount" xorm:"not null default 0.00 comment('金额') DECIMAL(6,2)"`
Memo string `json:"memo" xorm:"not null default '' comment('备注') VARCHAR(255)"`
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
OutTradeNo string `json:"out_trade_no" xorm:"default '' comment('订单号') VARCHAR(50)"`
OutRequestNo string `json:"out_request_no" xorm:"not null default '' comment('退款请求号') VARCHAR(50)"`
Uid int `json:"uid" xorm:"not null default 0 comment('uid') INT(11)"`
IdentityId int `json:"identity_id" xorm:"not null default 0 comment('身份id') INT(11)"`
RecordsId int `json:"records_id" xorm:"not null default 0 comment('记录id') INT(11)"`
State int `json:"state" xorm:"not null default 1 comment('状态(1:审核中 2:审核通过 3:审核拒绝 4:退款已完成)') TINYINT(1)"`
Amount string `json:"amount" xorm:"not null default 0.00 comment('金额') DECIMAL(6,2)"`
Memo string `json:"memo" xorm:"not null default '' comment('备注') VARCHAR(255)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

+ 13
- 17
app/db/model/central_kitchen_for_school_with_spec.go View File

@@ -1,21 +1,17 @@
package model

import (
"time"
)

type CentralKitchenForSchoolWithSpec struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
EnterpriseId int `json:"enterprise_id" xorm:"not null comment('单位id') INT(11)"`
IsOpenBreakfast int `json:"is_open_breakfast" xorm:"not null default 0 comment('是否开启早餐(1:开启 0:关闭)') TINYINT(1)"`
IsOpenLunch int `json:"is_open_lunch" xorm:"default 0 comment('是否开启午餐(1:开启 0:关闭)') TINYINT(1)"`
IsOpenDinner int `json:"is_open_dinner" xorm:"default 0 comment('是否开启晚餐(1:开启 0:关闭)') TINYINT(1)"`
BreakfastUnitPrice string `json:"breakfast_unit_price" xorm:"not null default 0.00 comment('早餐-单价') DECIMAL(4,2)"`
LunchUnitPrice string `json:"lunch_unit_price" xorm:"not null default 0.00 comment('午餐-单价') DECIMAL(4,2)"`
DinnerUnitPrice string `json:"dinner_unit_price" xorm:"not null default 0.00 comment('晚餐-单价') DECIMAL(4,2)"`
BreakfastUnitPriceForTeacher string `json:"breakfast_unit_price_for_teacher" xorm:"not null default 0.00 comment('教师-早餐-单价') DECIMAL(4,2)"`
LunchUnitPriceForTeacher string `json:"lunch_unit_price_for_teacher" xorm:"not null default 0.00 comment('教师-午餐-单价') DECIMAL(4,2)"`
DinnerUnitPriceForTeacher string `json:"dinner_unit_price_for_teacher" xorm:"not null default 0.00 comment('教师-晚餐-单价') DECIMAL(4,2)"`
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
EnterpriseId int `json:"enterprise_id" xorm:"not null comment('单位id') INT(11)"`
IsOpenBreakfast int `json:"is_open_breakfast" xorm:"not null default 0 comment('是否开启早餐(1:开启 0:关闭)') TINYINT(1)"`
IsOpenLunch int `json:"is_open_lunch" xorm:"default 0 comment('是否开启午餐(1:开启 0:关闭)') TINYINT(1)"`
IsOpenDinner int `json:"is_open_dinner" xorm:"default 0 comment('是否开启晚餐(1:开启 0:关闭)') TINYINT(1)"`
BreakfastUnitPrice string `json:"breakfast_unit_price" xorm:"not null default 0.00 comment('早餐-单价') DECIMAL(4,2)"`
LunchUnitPrice string `json:"lunch_unit_price" xorm:"not null default 0.00 comment('午餐-单价') DECIMAL(4,2)"`
DinnerUnitPrice string `json:"dinner_unit_price" xorm:"not null default 0.00 comment('晚餐-单价') DECIMAL(4,2)"`
BreakfastUnitPriceForTeacher string `json:"breakfast_unit_price_for_teacher" xorm:"not null default 0.00 comment('教师-早餐-单价') DECIMAL(4,2)"`
LunchUnitPriceForTeacher string `json:"lunch_unit_price_for_teacher" xorm:"not null default 0.00 comment('教师-午餐-单价') DECIMAL(4,2)"`
DinnerUnitPriceForTeacher string `json:"dinner_unit_price_for_teacher" xorm:"not null default 0.00 comment('教师-晚餐-单价') DECIMAL(4,2)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

+ 7
- 11
app/db/model/class.go View File

@@ -1,15 +1,11 @@
package model

import (
"time"
)

type Class struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Name string `json:"name" xorm:"not null default '' comment('名称') VARCHAR(255)"`
Memo string `json:"memo" xorm:"not null default '' comment('备注') VARCHAR(255)"`
GradeId int `json:"grade_id" xorm:"not null default 0 comment('年级id') INT(11)"`
EnterpriseId int `json:"enterprise_id" xorm:"not null default 0 comment('单位id') INT(11)"`
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Name string `json:"name" xorm:"not null default '' comment('名称') VARCHAR(255)"`
Memo string `json:"memo" xorm:"not null default '' comment('备注') VARCHAR(255)"`
GradeId int `json:"grade_id" xorm:"not null default 0 comment('年级id') INT(11)"`
EnterpriseId int `json:"enterprise_id" xorm:"not null default 0 comment('单位id') INT(11)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

+ 8
- 12
app/db/model/company.go View File

@@ -1,16 +1,12 @@
package model

import (
"time"
)

type Company struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Name string `json:"name" xorm:"not null default '' comment('名称') VARCHAR(255)"`
State int32 `json:"state" xorm:"not null default 1 comment('状态(1:正常 2:冻结)') TINYINT(1)"`
LeadName string `json:"lead_name" xorm:"not null default '' comment('负责人姓名') VARCHAR(50)"`
LeadPhone string `json:"lead_phone" xorm:"not null default '' comment('负责人手机号') VARCHAR(50)"`
Memo string `json:"memo" xorm:"not null default '' comment('备注信息') VARCHAR(244)"`
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Name string `json:"name" xorm:"not null default '' comment('名称') VARCHAR(255)"`
State int32 `json:"state" xorm:"not null default 1 comment('状态(1:正常 2:冻结)') TINYINT(1)"`
LeadName string `json:"lead_name" xorm:"not null default '' comment('负责人姓名') VARCHAR(50)"`
LeadPhone string `json:"lead_phone" xorm:"not null default '' comment('负责人手机号') VARCHAR(50)"`
Memo string `json:"memo" xorm:"not null default '' comment('备注信息') VARCHAR(244)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

+ 9
- 13
app/db/model/enterprise.go View File

@@ -1,17 +1,13 @@
package model

import (
"time"
)

type Enterprise struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Name string `json:"name" xorm:"not null default '' comment('名称') VARCHAR(255)"`
Pvd int32 `json:"pvd" xorm:"not null default 1 comment('场景(1:央厨配送 2:自营食堂)') TINYINT(1)"`
Kind int32 `json:"kind" xorm:"not null default 1 comment('种类(1:央厨-学校 2:央厨-工厂 3:自营-学校 4:自营-工厂)') TINYINT(1)"`
CompanyId int `json:"company_id" xorm:"not null default 0 comment('所属公司id') INT(11)"`
State int32 `json:"state" xorm:"not null default 1 comment('状态(1:正常 2:冻结)') TINYINT(1)"`
Memo string `json:"memo" xorm:"not null default '' comment('备注信息') VARCHAR(244)"`
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Name string `json:"name" xorm:"not null default '' comment('名称') VARCHAR(255)"`
Pvd int32 `json:"pvd" xorm:"not null default 1 comment('场景(1:央厨配送 2:自营食堂)') TINYINT(1)"`
Kind int32 `json:"kind" xorm:"not null default 1 comment('种类(1:央厨-学校 2:央厨-工厂 3:自营-学校 4:自营-工厂)') TINYINT(1)"`
CompanyId int `json:"company_id" xorm:"not null default 0 comment('所属公司id') INT(11)"`
State int32 `json:"state" xorm:"not null default 1 comment('状态(1:正常 2:冻结)') TINYINT(1)"`
Memo string `json:"memo" xorm:"not null default '' comment('备注信息') VARCHAR(244)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

+ 6
- 10
app/db/model/grade.go View File

@@ -1,14 +1,10 @@
package model

import (
"time"
)

type Grade struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
EnterpriseId int `json:"enterprise_id" xorm:"not null default 0 comment('单位id') INT(11)"`
Name string `json:"name" xorm:"not null default '' comment('名称') VARCHAR(255)"`
Memo string `json:"memo" xorm:"not null default '' comment('备注') VARCHAR(255)"`
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
EnterpriseId int `json:"enterprise_id" xorm:"not null default 0 comment('单位id') INT(11)"`
Name string `json:"name" xorm:"not null default '' comment('名称') VARCHAR(255)"`
Memo string `json:"memo" xorm:"not null default '' comment('备注') VARCHAR(255)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

+ 6
- 10
app/db/model/notice.go View File

@@ -1,14 +1,10 @@
package model

import (
"time"
)

type Notice struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Name string `json:"name" xorm:"not null default '' comment('名称') VARCHAR(255)"`
Content string `json:"content" xorm:"not null comment('内容(json存储)') TEXT"`
Sort int `json:"sort" xorm:"not null default 0 comment('排序') TINYINT(3)"`
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Name string `json:"name" xorm:"not null default '' comment('名称') VARCHAR(255)"`
Content string `json:"content" xorm:"not null comment('内容(json存储)') TEXT"`
Sort int `json:"sort" xorm:"not null default 0 comment('排序') TINYINT(3)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

+ 7
- 10
app/db/model/permission_group.go View File

@@ -1,14 +1,11 @@
package model

import (
"time"
)

type PermissionGroup struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
ParentId int `json:"parent_id" xorm:"not null default 0 comment('父级id') INT(11)"`
Name string `json:"name" xorm:"not null default '' comment('名称') VARCHAR(255)"`
State int `json:"state" xorm:"not null default 1 comment('状态(1:正常 2:废弃)') TINYINT(1)"`
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
ParentId int `json:"parent_id" xorm:"not null default 0 comment('父级id') INT(11)"`
Key string `json:"key" xorm:"not null default '' comment('') VARCHAR(255)"`
Name string `json:"name" xorm:"not null default '' comment('名称') VARCHAR(255)"`
State int `json:"state" xorm:"not null default 1 comment('状态(1:正常 2:废弃)') TINYINT(1)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

+ 5
- 9
app/db/model/permission_group_permission.go View File

@@ -1,13 +1,9 @@
package model

import (
"time"
)

type PermissionGroupPermission struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
GroupId int `json:"group_id" xorm:"not null default 0 comment('权限组id') INT(11)"`
PermissionId int `json:"permission_id" xorm:"not null default 0 comment('权限id') INT(11)"`
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
GroupId int `json:"group_id" xorm:"not null default 0 comment('权限组id') INT(11)"`
PermissionId int `json:"permission_id" xorm:"not null default 0 comment('权限id') INT(11)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

+ 5
- 9
app/db/model/role_permission_group.go View File

@@ -1,13 +1,9 @@
package model

import (
"time"
)

type RolePermissionGroup struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
RoleId int `json:"role_id" xorm:"not null default 0 comment('角色id') INT(11)"`
GroupId int `json:"group_id" xorm:"not null default 0 comment('权限组id') INT(11)"`
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
RoleId int `json:"role_id" xorm:"not null default 0 comment('角色id') INT(11)"`
GroupId int `json:"group_id" xorm:"not null default 0 comment('权限组id') INT(11)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

+ 8
- 12
app/db/model/self_support_for_school_info.go View File

@@ -1,16 +1,12 @@
package model

import (
"time"
)

type SelfSupportForSchoolInfo struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
EnterpriseId int `json:"enterprise_id" xorm:"not null default 0 comment('单位id') INT(11)"`
SchoolCode string `json:"school_code" xorm:"not null default '' comment('学校内标') VARCHAR(255)"`
SchoolStdCode string `json:"school_std_code" xorm:"not null default '' comment('学校外标') VARCHAR(255)"`
GroupKey string `json:"group_key" xorm:"not null default '' comment('学校人脸库ID') VARCHAR(255)"`
Memo string `json:"memo" xorm:"not null default '' VARCHAR(255)"`
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
EnterpriseId int `json:"enterprise_id" xorm:"not null default 0 comment('单位id') INT(11)"`
SchoolCode string `json:"school_code" xorm:"not null default '' comment('学校内标') VARCHAR(255)"`
SchoolStdCode string `json:"school_std_code" xorm:"not null default '' comment('学校外标') VARCHAR(255)"`
GroupKey string `json:"group_key" xorm:"not null default '' comment('学校人脸库ID') VARCHAR(255)"`
Memo string `json:"memo" xorm:"not null default '' VARCHAR(255)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

+ 8
- 12
app/db/model/user.go View File

@@ -1,16 +1,12 @@
package model

import (
"time"
)

type User struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
UserId string `json:"user_id" xorm:"not null default '' comment('支付宝用户的唯一userId') VARCHAR(255)"`
Nickname string `json:"nickname" xorm:"not null default '' comment('支付宝昵称') VARCHAR(255)"`
Avatar string `json:"avatar" xorm:"not null default '' comment('支付宝头像') VARCHAR(255)"`
Phone string `json:"phone" xorm:"not null default '' comment('手机号') VARCHAR(255)"`
Memo string `json:"memo" xorm:"not null default '' comment('备注信息') VARCHAR(244)"`
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
UserId string `json:"user_id" xorm:"not null default '' comment('支付宝用户的唯一userId') VARCHAR(255)"`
Nickname string `json:"nickname" xorm:"not null default '' comment('支付宝昵称') VARCHAR(255)"`
Avatar string `json:"avatar" xorm:"not null default '' comment('支付宝头像') VARCHAR(255)"`
Phone string `json:"phone" xorm:"not null default '' comment('手机号') VARCHAR(255)"`
Memo string `json:"memo" xorm:"not null default '' comment('备注信息') VARCHAR(244)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

Loading…
Cancel
Save