Browse Source

update

tmp
DengBiao 8 months ago
parent
commit
56f617843c
2 changed files with 25 additions and 2 deletions
  1. +1
    -1
      app/admin/hdl/enterprise_manage/hdl_central_kitchen_for_school.go
  2. +24
    -1
      app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go

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

@@ -825,7 +825,7 @@ func CentralKitchenForSchoolOrdList(c *gin.Context) {
return
}

personNum, orderCountByDay, orderCountByMonth, orderCountByTerm, consumeAmount, err := svc2.CentralKitchenForSchoolOrdStatistics(req)
personNum, orderCountByDay, orderCountByMonth, orderCountByTerm, consumeAmount, err := svc2.CentralKitchenForSchoolOrdStatistics(c, req)
if err != nil {
e.OutErr(c, e.ERR, err.Error())
return


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

@@ -754,7 +754,7 @@ func CentralKitchenForSchoolOrdList(c *gin.Context, req md.CentralKitchenForScho
return
}

func CentralKitchenForSchoolOrdStatistics(req md.CentralKitchenForSchoolOrdListReq) (personNum, orderCountByDay, orderCountByMonth, orderCountByTerm int64, consumeAmount float64, err error) {
func CentralKitchenForSchoolOrdStatistics(c *gin.Context, req md.CentralKitchenForSchoolOrdListReq) (personNum, orderCountByDay, orderCountByMonth, orderCountByTerm int64, consumeAmount float64, err error) {
var classWithUserIdentityIdsOne []int
var classWithUserIdentityIdsTwo []int
classWithUserDb := db.ClassWithUserDb{}
@@ -789,6 +789,29 @@ func CentralKitchenForSchoolOrdStatistics(req md.CentralKitchenForSchoolOrdListR
}

sess1, sess2, sess3, sess4, sess5 := db.Db.Where("1=1"), db.Db.Where("1=1"), db.Db.Where("1=1"), db.Db.Where("1=1"), db.Db.Where("1=1")
admin := svc.GetUser(c)
if admin.IsSuperAdministrator != enum.IsSuperAdministratorTure {
adminWithEnterpriseDb := db.AdminWithEnterpriseDb{}
adminWithEnterpriseDb.Set()
adminWithEnterprise, err1 := adminWithEnterpriseDb.FindAdminWithEnterprise(admin.AdmId)
if err1 != nil {
e.OutErr(c, e.ERR_DB_ORM, err1.Error())
return
}
var enterPriseIds []int
for _, v1 := range *adminWithEnterprise {
enterPriseIds = append(enterPriseIds, v1.EnterpriseId)
}
if len(enterPriseIds) == 0 {
return
}
sess1.In("central_kitchen_for_school_package_ord_for_reserve.enterprise_id", enterPriseIds)
sess2.In("central_kitchen_for_school_package_ord_for_reserve.enterprise_id", enterPriseIds)
sess3.In("central_kitchen_for_school_package_ord_for_reserve.enterprise_id", enterPriseIds)
sess4.In("central_kitchen_for_school_package_ord_for_reserve.enterprise_id", enterPriseIds)
sess5.In("central_kitchen_for_school_package_ord_for_reserve.enterprise_id", enterPriseIds)
}

if req.EnterpriseId != 0 {
sess1.And("central_kitchen_for_school_package_ord.enterprise_id =?", req.EnterpriseId)
sess2.And("central_kitchen_for_school_package_ord.enterprise_id =?", req.EnterpriseId)


Loading…
Cancel
Save