This commit is contained in:
ziming 2025-08-01 11:43:37 +08:00
parent ef67a3c666
commit 40b5563852
4 changed files with 21 additions and 22 deletions

View File

@ -47,11 +47,10 @@ type FindInBatchesUseBo struct {
}
type FindInBatchesBo struct {
StartTime *time.Time
EndTime *time.Time
ProductNo string
OrderNo []string
OutBizNo []string
VoucherNo []string
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
ProductNo string `json:"product_no"`
OrderNos []string `json:"order_nos"`
OutBizNos []string `json:"out_biz_nos"`
VoucherNos []string `json:"voucher_nos"`
}

View File

@ -39,20 +39,20 @@ func (p *OrderRepoImpl) SpecifyFindInBatches(ctx context.Context, req *bo.FindIn
tx = tx.Where("product_no = ?", req.ProductNo)
}
if req.StartTime != nil && req.EndTime != nil {
if req.StartTime != "" && req.EndTime != "" {
tx = tx.Where("receive_success_time BETWEEN ? AND ?", req.StartTime, req.EndTime)
}
if req.OrderNo != nil {
tx = tx.Where("order_no IN (?)", req.OrderNo)
if req.OrderNos != nil {
tx = tx.Where("order_no IN (?)", req.OrderNos)
}
if req.OutBizNo != nil {
tx = tx.Where("out_biz_no IN (?)", req.OutBizNo)
if req.OutBizNos != nil {
tx = tx.Where("out_biz_no IN (?)", req.OutBizNos)
}
if req.VoucherNo != nil {
tx = tx.Where("voucher_no IN (?)", req.VoucherNo)
if req.VoucherNos != nil {
tx = tx.Where("voucher_no IN (?)", req.VoucherNos)
}
var results = make([]*model.Order, 0)

View File

@ -33,20 +33,20 @@ func (p *OrderBakRepoImpl) SpecifyFindInBatches(ctx context.Context, req *bo.Fin
tx = tx.Where("product_no = ?", req.ProductNo)
}
if req.StartTime != nil && req.EndTime != nil {
if req.StartTime != "" && req.EndTime != "" {
tx = tx.Where("receive_success_time BETWEEN ? AND ?", req.StartTime, req.EndTime)
}
if req.OrderNo != nil {
tx = tx.Where("order_no IN (?)", req.OrderNo)
if req.OrderNos != nil {
tx = tx.Where("order_no IN (?)", req.OrderNos)
}
if req.OutBizNo != nil {
tx = tx.Where("out_biz_no IN (?)", req.OutBizNo)
if req.OutBizNos != nil {
tx = tx.Where("out_biz_no IN (?)", req.OutBizNos)
}
if req.VoucherNo != nil {
tx = tx.Where("voucher_no IN (?)", req.VoucherNo)
if req.VoucherNos != nil {
tx = tx.Where("voucher_no IN (?)", req.VoucherNos)
}
var results = make([]*model.OrderBak, 0)

View File

@ -172,7 +172,7 @@ func (this *CmbService) SpecifyNotification(ctx http.Context) error {
return fmt.Errorf("req is empty")
}
if req.OutBizNo == nil && req.OrderNo == nil && req.VoucherNo == nil {
if req.OutBizNos == nil && req.OrderNos == nil && req.VoucherNos == nil {
return fmt.Errorf("out_biz_no or order_no or voucher_no is empty")
}