totalOrder

This commit is contained in:
jiangyong27 2025-03-29 16:16:58 +08:00
parent 82b46a918b
commit 8d0669fc2f
2 changed files with 8 additions and 3 deletions

View File

@ -23,9 +23,11 @@ func (d *ExternalCorpOrder) QueryOwnerOrder(owner string, startTime, endTime int
var o []*model.ExternalCorpOrder
if owner != "" {
tx.Where("cp_user.username = ?", owner)
}
tx.Where(orderTable+".status = ?", 2)
tx.Where("cp_user.username = ?", owner)
tx.Where(orderTable+".pay_time >= ?", startTime)
tx.Where(orderTable+".pay_time <= ?", endTime)
@ -48,7 +50,6 @@ func (d *ExternalCorpOrder) QueryProcessOrder(owner string, startTime, endTime i
var o []*model.ExternalCorpOrder
tx.Where(orderTable+".process_status = ?", 2)
tx.Where("cp_user.username = ?", owner)
tx.Where(orderTable+".pay_time >= ?", startTime)
tx.Where(orderTable+".pay_time <= ?", endTime)

View File

@ -31,8 +31,12 @@ func (s *SalaryCalculator1002) Calculate(salary *model.StaffSalary) map[string]i
if err != nil {
log.Errorf("db error:%s", err.Error())
}
totalOrders, err := dao.NewExternalCorpOrder().QueryOwnerOrder("", startTime, endTime)
if err != nil {
log.Errorf("db error:%s", err.Error())
}
data["orderNum"] = len(orders)
data["totalOrderNum"] = len(totalOrders)
//2.处理的订单
processOrders, err := dao.NewExternalCorpOrder().QueryProcessOrder(s.user.Username, startTime, endTime)