|
|
@@ -848,10 +848,10 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD |
|
|
|
sess.And("central_kitchen_for_school_package_ord.enterprise_id =?", req.EnterpriseId) |
|
|
|
} |
|
|
|
if req.StartDate != "" { |
|
|
|
sess.And("central_kitchen_for_school_package_ord.create_at >= ?", req.StartDate) |
|
|
|
sess.And("central_kitchen_for_school_package_ord.pay_at >= ?", req.StartDate) |
|
|
|
} |
|
|
|
if req.EndDate != "" { |
|
|
|
sess.And("central_kitchen_for_school_package_ord.create_at <= ?", req.EndDate) |
|
|
|
sess.And("central_kitchen_for_school_package_ord.pay_at <= ?", req.EndDate) |
|
|
|
} |
|
|
|
if req.EnterPriseKind != 0 { |
|
|
|
sess.And("enterprise.kind = ?", req.EnterPriseKind) |
|
|
@@ -1759,7 +1759,7 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD |
|
|
|
for _, v := range m { |
|
|
|
var income, refund string |
|
|
|
//统计收入 |
|
|
|
sql1 := fmt.Sprintf("SELECT sum(total_price) as total FROM central_kitchen_for_school_package_ord where state = 1 and enterprise_id = %d and create_at >= '%s' and create_at < '%s'", v.Id, req.StartDate, req.EndDate) |
|
|
|
sql1 := fmt.Sprintf("SELECT sum(total_price) as total FROM central_kitchen_for_school_package_ord where state = 1 and enterprise_id = %d and pay_at >= '%s' and pay_at < '%s'", v.Id, req.StartDate, req.EndDate) |
|
|
|
mapArr1, err := db.QueryNativeString(db.Db, sql1) |
|
|
|
if err != nil { |
|
|
|
logx.Error(err) |
|
|
@@ -1818,10 +1818,10 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD |
|
|
|
sess.And("central_kitchen_for_school_package_ord.enterprise_id =?", req.EnterpriseId) |
|
|
|
} |
|
|
|
if req.StartDate != "" { |
|
|
|
sess.And("central_kitchen_for_school_package_ord.create_at >= ?", req.StartDate) |
|
|
|
sess.And("central_kitchen_for_school_package_ord.pay_at >= ?", req.StartDate) |
|
|
|
} |
|
|
|
if req.EndDate != "" { |
|
|
|
sess.And("central_kitchen_for_school_package_ord.create_at <= ?", req.EndDate) |
|
|
|
sess.And("central_kitchen_for_school_package_ord.pay_at <= ?", req.EndDate) |
|
|
|
} |
|
|
|
if req.EnterPriseKind != 0 { |
|
|
|
sess.And("enterprise.kind = ?", req.EnterPriseKind) |
|
|
|