Browse Source

update

add_mode
DengBiao 1 year ago
parent
commit
e2d3d95170
2 changed files with 23 additions and 1 deletions
  1. +22
    -1
      app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go
  2. +1
    -0
      app/router/admin_router.go

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

@@ -1332,6 +1332,8 @@ func CentralKitchenForSchoolGradeDelete(c *gin.Context) {


func CentralKitchenForSchoolClassDelete(c *gin.Context) { func CentralKitchenForSchoolClassDelete(c *gin.Context) {
classId := c.Param("id") classId := c.Param("id")
classWithUserDb := db.ClassWithUserDb{}

//1、查找当前年级 //1、查找当前年级
classDb := db.ClassDb{} classDb := db.ClassDb{}
classDb.Set(0) classDb.Set(0)
@@ -1347,7 +1349,6 @@ func CentralKitchenForSchoolClassDelete(c *gin.Context) {
} }


//2、删除当前班级下的所有关联学生 //2、删除当前班级下的所有关联学生
classWithUserDb := db.ClassWithUserDb{}
classWithUserDb.Set() classWithUserDb.Set()
_, err = classWithUserDb.DeleteClassWithUserByClass(classId) _, err = classWithUserDb.DeleteClassWithUserByClass(classId)
if err != nil { if err != nil {
@@ -1357,3 +1358,23 @@ func CentralKitchenForSchoolClassDelete(c *gin.Context) {
e.OutSuc(c, "success", nil) e.OutSuc(c, "success", nil)
return return
} }

func CentralKitchenForSchoolClassDeleteCheck(c *gin.Context) {
classId := c.Param("id")
classWithUserDb := db.ClassWithUserDb{}
classWithUserDb.Set()
classWithUsers, err := classWithUserDb.FindUserIdentity(classId)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
var isHasStudent = false
if len(*classWithUsers) > 0 {
isHasStudent = true
}

e.OutSuc(c, map[string]interface{}{
"is_has_student": isHasStudent,
}, nil)
return
}

+ 1
- 0
app/router/admin_router.go View File

@@ -172,6 +172,7 @@ func rEnterpriseManage(r *gin.RouterGroup) {
r.DELETE("/centralKitchenForSchool/gradeDelete/:id", hdl.CentralKitchenForSchoolGradeDelete) //"央厨-学校"年级删除 r.DELETE("/centralKitchenForSchool/gradeDelete/:id", hdl.CentralKitchenForSchoolGradeDelete) //"央厨-学校"年级删除
r.POST("/centralKitchenForSchool/classList", hdl.CentralKitchenForSchoolClassList) //"央厨-学校"班级列表 r.POST("/centralKitchenForSchool/classList", hdl.CentralKitchenForSchoolClassList) //"央厨-学校"班级列表
r.DELETE("/centralKitchenForSchool/classDelete/:id", hdl.CentralKitchenForSchoolClassDelete) //"央厨-学校"班级删除 r.DELETE("/centralKitchenForSchool/classDelete/:id", hdl.CentralKitchenForSchoolClassDelete) //"央厨-学校"班级删除
r.DELETE("/centralKitchenForSchool/classDeleteCheck/:id", hdl.CentralKitchenForSchoolClassDeleteCheck) //"央厨-学校"检测班级删除
r.POST("/centralKitchenForSchool/ordList", hdl.CentralKitchenForSchoolOrdList) //"央厨-学校"订单列表 r.POST("/centralKitchenForSchool/ordList", hdl.CentralKitchenForSchoolOrdList) //"央厨-学校"订单列表
r.GET("/centralKitchenForSchool/ordDetail", hdl.CentralKitchenForSchoolOrdDetail) //"央厨-学校"订单详情 r.GET("/centralKitchenForSchool/ordDetail", hdl.CentralKitchenForSchoolOrdDetail) //"央厨-学校"订单详情
r.POST("/centralKitchenForSchool/ordRefund", hdl.CentralKitchenForSchoolOrdRefund) //"央厨-学校"订单退款 r.POST("/centralKitchenForSchool/ordRefund", hdl.CentralKitchenForSchoolOrdRefund) //"央厨-学校"订单退款


Loading…
Cancel
Save