Browse Source

update

add_mode
DengBiao 1 year ago
parent
commit
f921c49f47
4 changed files with 17 additions and 17 deletions
  1. +1
    -1
      app/admin/svc/order/svc_central_kitchen_for_school_order.go
  2. +13
    -13
      app/admin/svc/svc_data_statisstics.go
  3. +2
    -1
      app/db/db_central_kitchen_for_school_user_with_day.go
  4. +1
    -2
      app/task/init.go

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

@@ -156,7 +156,7 @@ func CentralKitchenForSchoolOrderRefundAudit(req md.CentralKitchenForSchoolOrder
session.Begin()

//限制30条
if len(req.Ids) > 30 {
if len(req.Ids) > 500 {
err = errors.New("受理数据过长,请分批次处理")
_ = session.Rollback()
return


+ 13
- 13
app/admin/svc/svc_data_statisstics.go View File

@@ -643,9 +643,9 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD
if req.EnterpriseId != 0 {
sess.And("central_kitchen_for_school_package_ord_for_reserve.enterprise_id =?", req.EnterpriseId)
}
//if req.StartDate != "" {
// sess.And("central_kitchen_for_school_package_ord_for_reserve.meal_time_start >= ?", req.StartDate)
//}
if req.StartDate != "" {
sess.And("central_kitchen_for_school_package_ord_for_reserve.meal_time_start >= ? or central_kitchen_for_school_package_ord_for_reserve.meal_time_end <= ?", req.StartDate, req.EndDate)
}
//if req.EndDate != "" {
// sess.And("central_kitchen_for_school_package_ord_for_reserve.meal_time_start <= ?", req.EndDate)
//}
@@ -684,7 +684,7 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD

count, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNo(
v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum.CentralKitchenForSchoolUserWithDayStateForCancel,
req.StartDate, req.EndDate)
req.StartDate, req.EndDate, req.MealKindList)
if err2 != nil {
logx.Error(err)
println("<<<<SelfSupportForSchoolDataStatisticsExport3>>>>>Error:::", err.Error())
@@ -811,9 +811,9 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD
if req.EnterpriseId != 0 {
sess.And("central_kitchen_for_school_package_ord_for_reserve.enterprise_id =?", req.EnterpriseId)
}
//if req.StartDate != "" {
// sess.And("central_kitchen_for_school_package_ord_for_reserve.meal_time_start >= ?", req.StartDate)
//}
if req.StartDate != "" {
sess.And("central_kitchen_for_school_package_ord_for_reserve.meal_time_start >= ? or central_kitchen_for_school_package_ord_for_reserve.meal_time_end <= ?", req.StartDate, req.EndDate)
}
//if req.EndDate != "" {
// sess.And("central_kitchen_for_school_package_ord_for_reserve.meal_time_start <= ?", req.EndDate)
//}
@@ -856,7 +856,7 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD

count, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNo(
v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum.CentralKitchenForSchoolUserWithDayStateForCancel,
req.StartDate, req.EndDate)
req.StartDate, req.EndDate, req.MealKindList)
if err2 != nil {
logx.Error(err)
println("<<<<SelfSupportForSchoolDataStatisticsExport3>>>>>Error:::", err.Error())
@@ -1431,11 +1431,11 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD
sess.And("central_kitchen_for_school_package_ord_for_reserve.enterprise_id =?", req.EnterpriseId)
}
if req.StartDate != "" {
sess.And("central_kitchen_for_school_package_ord_for_reserve.meal_time_start >= ?", req.StartDate)
}
if req.EndDate != "" {
sess.And("central_kitchen_for_school_package_ord_for_reserve.meal_time_start <= ?", req.EndDate)
sess.And("central_kitchen_for_school_package_ord_for_reserve.meal_time_start >= ? or central_kitchen_for_school_package_ord_for_reserve.meal_time_end <= ?", req.StartDate, req.EndDate)
}
//if req.EndDate != "" {
// sess.And("central_kitchen_for_school_package_ord_for_reserve.meal_time_start <= ?", req.EndDate)
//}
if len(req.MealKindList) > 0 {
sess.In("central_kitchen_for_school_package_ord_for_reserve.kind", req.MealKindList)
}
@@ -1459,7 +1459,7 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD
}
count, err2 := centralKitchenForSchoolUserWithDayDb.CountCentralKitchenForSchoolUserWithDayByOrdNo(
v.CentralKitchenForSchoolPackageOrdForReserve.OutTradeNo, enum.CentralKitchenForSchoolUserWithDayStateForCancel,
req.StartDate, req.EndDate)
req.StartDate, req.EndDate, req.MealKindList)
if err2 != nil {
logx.Error(err)
println("<<<<SelfSupportForSchoolDataStatisticsExport3>>>>>Error:::", err.Error())


+ 2
- 1
app/db/db_central_kitchen_for_school_user_with_day.go View File

@@ -65,13 +65,14 @@ func (centralKitchenForSchoolUserWithDayDb *CentralKitchenForSchoolUserWithDayDb
return resp, nil
}

func (centralKitchenForSchoolUserWithDayDb *CentralKitchenForSchoolUserWithDayDb) CountCentralKitchenForSchoolUserWithDayByOrdNo(ordNo string, state int, startDate, endDate string) (count int64, err error) {
func (centralKitchenForSchoolUserWithDayDb *CentralKitchenForSchoolUserWithDayDb) CountCentralKitchenForSchoolUserWithDayByOrdNo(ordNo string, state int, startDate, endDate string, kindList []int) (count int64, err error) {
var m model.CentralKitchenForSchoolUserWithDay
sDate, _ := time.ParseInLocation("2006-01-02 15:04:05", startDate, time.Local)
eDate, _ := time.ParseInLocation("2006-01-02 15:04:05", endDate, time.Local)

count, err = centralKitchenForSchoolUserWithDayDb.Db.Where("ord_no =?", ordNo).And("state !=?", state).
And("date >= ?", sDate.Format("2006-01-02")).And("date <= ?", eDate.Format("2006-01-02")).
In("kind", kindList).
Count(&m)
return count, nil
}


+ 1
- 2
app/task/init.go View File

@@ -23,8 +23,7 @@ var (
)

func Init() {
// 初始化任务列表
initTasks()
// 初始化任务列表initTasks()
var err error
timer = cron.New()
// reload为初始化数据库方法


Loading…
Cancel
Save