diff --git a/app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go b/app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go index 8b8b180..eae2e38 100644 --- a/app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go +++ b/app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go @@ -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 { diff --git a/app/admin/hdl/hdl_banner.go b/app/admin/hdl/hdl_banner.go index 4474015..84c5406 100644 --- a/app/admin/hdl/hdl_banner.go +++ b/app/admin/hdl/hdl_banner.go @@ -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()) diff --git a/app/admin/hdl/hdl_comm.go b/app/admin/hdl/hdl_comm.go index e373c3c..6308df9 100644 --- a/app/admin/hdl/hdl_comm.go +++ b/app/admin/hdl/hdl_comm.go @@ -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{}{ diff --git a/app/admin/hdl/hdl_company.go b/app/admin/hdl/hdl_company.go index 134d44e..3210516 100644 --- a/app/admin/hdl/hdl_company.go +++ b/app/admin/hdl/hdl_company.go @@ -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()) diff --git a/app/admin/hdl/hdl_enterprise.go b/app/admin/hdl/hdl_enterprise.go index dec5a9f..9a34651 100644 --- a/app/admin/hdl/hdl_enterprise.go +++ b/app/admin/hdl/hdl_enterprise.go @@ -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()) diff --git a/app/admin/hdl/hdl_notice.go b/app/admin/hdl/hdl_notice.go index 3806a4a..fd884f0 100644 --- a/app/admin/hdl/hdl_notice.go +++ b/app/admin/hdl/hdl_notice.go @@ -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(¬ice) 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()) diff --git a/app/admin/hdl/hdl_role.go b/app/admin/hdl/hdl_role.go index 85ea1b7..eb27b8b 100644 --- a/app/admin/hdl/hdl_role.go +++ b/app/admin/hdl/hdl_role.go @@ -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]) } } diff --git a/app/admin/md/md_enterprise_manage.go b/app/admin/md/md_enterprise_manage.go index 9641efc..ff5fcbb 100644 --- a/app/admin/md/md_enterprise_manage.go +++ b/app/admin/md/md_enterprise_manage.go @@ -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:"姓名"` diff --git a/app/admin/md/md_role.go b/app/admin/md/md_role.go index a38fe81..445d17b 100644 --- a/app/admin/md/md_role.go +++ b/app/admin/md/md_role.go @@ -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"` diff --git a/app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go b/app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go index 2d69c6d..3cc9f11 100644 --- a/app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go +++ b/app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go @@ -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"), }) } diff --git a/app/admin/svc/enterprise_manage/svc_enterprise_manage.go b/app/admin/svc/enterprise_manage/svc_enterprise_manage.go index 002a15c..9f78379 100644 --- a/app/admin/svc/enterprise_manage/svc_enterprise_manage.go +++ b/app/admin/svc/enterprise_manage/svc_enterprise_manage.go @@ -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) diff --git a/app/admin/svc/order/svc_central_kitchen_for_school_order.go b/app/admin/svc/order/svc_central_kitchen_for_school_order.go index 8365900..6c13058 100644 --- a/app/admin/svc/order/svc_central_kitchen_for_school_order.go +++ b/app/admin/svc/order/svc_central_kitchen_for_school_order.go @@ -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, }) } diff --git a/app/admin/svc/svc_role.go b/app/admin/svc/svc_role.go index 8446c7c..6ea92a9 100644 --- a/app/admin/svc/svc_role.go +++ b/app/admin/svc/svc_role.go @@ -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) diff --git a/app/admin/svc/svc_user.go b/app/admin/svc/svc_user.go index d513d51..30185a3 100644 --- a/app/admin/svc/svc_user.go +++ b/app/admin/svc/svc_user.go @@ -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 { diff --git a/app/customer/hdl/hdl_login.go b/app/customer/hdl/hdl_login.go index 8c00a4d..6a29a95 100644 --- a/app/customer/hdl/hdl_login.go +++ b/app/customer/hdl/hdl_login.go @@ -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) diff --git a/app/customer/svc/order/svc_central_kitchen_for_school_order.go b/app/customer/svc/order/svc_central_kitchen_for_school_order.go index 3f52278..7f6c03c 100644 --- a/app/customer/svc/order/svc_central_kitchen_for_school_order.go +++ b/app/customer/svc/order/svc_central_kitchen_for_school_order.go @@ -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, diff --git a/app/customer/svc/svc_auth.go b/app/customer/svc/svc_auth.go index ed08ef6..c80e69a 100644 --- a/app/customer/svc/svc_auth.go +++ b/app/customer/svc/svc_auth.go @@ -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) diff --git a/app/db/db_user_identity.go b/app/db/db_user_identity.go index e2b134a..8b93e7d 100644 --- a/app/db/db_user_identity.go +++ b/app/db/db_user_identity.go @@ -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 diff --git a/app/db/model/admin_role.go b/app/db/model/admin_role.go index 379d278..5a35baa 100644 --- a/app/db/model/admin_role.go +++ b/app/db/model/admin_role.go @@ -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"` } diff --git a/app/db/model/banner.go b/app/db/model/banner.go index 896b2fc..1f3812c 100644 --- a/app/db/model/banner.go +++ b/app/db/model/banner.go @@ -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"` } diff --git a/app/db/model/central_kitchen_for_school_set.go b/app/db/model/central_kitchen_for_school_set.go index dc38fe2..76e40f0 100644 --- a/app/db/model/central_kitchen_for_school_set.go +++ b/app/db/model/central_kitchen_for_school_set.go @@ -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"` } diff --git a/app/db/model/central_kitchen_for_school_user_refund_day.go b/app/db/model/central_kitchen_for_school_user_refund_day.go index 17fe6de..fd36e18 100644 --- a/app/db/model/central_kitchen_for_school_user_refund_day.go +++ b/app/db/model/central_kitchen_for_school_user_refund_day.go @@ -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"` } diff --git a/app/db/model/central_kitchen_for_school_with_spec.go b/app/db/model/central_kitchen_for_school_with_spec.go index 0d18bd9..5034f7d 100644 --- a/app/db/model/central_kitchen_for_school_with_spec.go +++ b/app/db/model/central_kitchen_for_school_with_spec.go @@ -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"` } diff --git a/app/db/model/class.go b/app/db/model/class.go index eec0e3d..5c18acc 100644 --- a/app/db/model/class.go +++ b/app/db/model/class.go @@ -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"` } diff --git a/app/db/model/company.go b/app/db/model/company.go index 4bed1a3..e5f8a57 100644 --- a/app/db/model/company.go +++ b/app/db/model/company.go @@ -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"` } diff --git a/app/db/model/enterprise.go b/app/db/model/enterprise.go index acfe562..5077905 100644 --- a/app/db/model/enterprise.go +++ b/app/db/model/enterprise.go @@ -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"` } diff --git a/app/db/model/grade.go b/app/db/model/grade.go index 55ad272..6e9e566 100644 --- a/app/db/model/grade.go +++ b/app/db/model/grade.go @@ -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"` } diff --git a/app/db/model/notice.go b/app/db/model/notice.go index 730ec42..4092398 100644 --- a/app/db/model/notice.go +++ b/app/db/model/notice.go @@ -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"` } diff --git a/app/db/model/permission_group.go b/app/db/model/permission_group.go index 07e0655..b0c5915 100644 --- a/app/db/model/permission_group.go +++ b/app/db/model/permission_group.go @@ -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"` } diff --git a/app/db/model/permission_group_permission.go b/app/db/model/permission_group_permission.go index f10a20c..7d1bad7 100644 --- a/app/db/model/permission_group_permission.go +++ b/app/db/model/permission_group_permission.go @@ -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"` } diff --git a/app/db/model/role_permission_group.go b/app/db/model/role_permission_group.go index a73a2c3..b9d04a1 100644 --- a/app/db/model/role_permission_group.go +++ b/app/db/model/role_permission_group.go @@ -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"` } diff --git a/app/db/model/self_support_for_school_info.go b/app/db/model/self_support_for_school_info.go index 3811c38..78b9a89 100644 --- a/app/db/model/self_support_for_school_info.go +++ b/app/db/model/self_support_for_school_info.go @@ -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"` } diff --git a/app/db/model/user.go b/app/db/model/user.go index 3776483..3635e45 100644 --- a/app/db/model/user.go +++ b/app/db/model/user.go @@ -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"` }