This commit is contained in:
parent
ef67a3c666
commit
40b5563852
|
|
@ -47,11 +47,10 @@ type FindInBatchesUseBo struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type FindInBatchesBo struct {
|
type FindInBatchesBo struct {
|
||||||
StartTime *time.Time
|
StartTime string `json:"start_time"`
|
||||||
EndTime *time.Time
|
EndTime string `json:"end_time"`
|
||||||
|
ProductNo string `json:"product_no"`
|
||||||
ProductNo string
|
OrderNos []string `json:"order_nos"`
|
||||||
OrderNo []string
|
OutBizNos []string `json:"out_biz_nos"`
|
||||||
OutBizNo []string
|
VoucherNos []string `json:"voucher_nos"`
|
||||||
VoucherNo []string
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,20 +39,20 @@ func (p *OrderRepoImpl) SpecifyFindInBatches(ctx context.Context, req *bo.FindIn
|
||||||
tx = tx.Where("product_no = ?", req.ProductNo)
|
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)
|
tx = tx.Where("receive_success_time BETWEEN ? AND ?", req.StartTime, req.EndTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.OrderNo != nil {
|
if req.OrderNos != nil {
|
||||||
tx = tx.Where("order_no IN (?)", req.OrderNo)
|
tx = tx.Where("order_no IN (?)", req.OrderNos)
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.OutBizNo != nil {
|
if req.OutBizNos != nil {
|
||||||
tx = tx.Where("out_biz_no IN (?)", req.OutBizNo)
|
tx = tx.Where("out_biz_no IN (?)", req.OutBizNos)
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.VoucherNo != nil {
|
if req.VoucherNos != nil {
|
||||||
tx = tx.Where("voucher_no IN (?)", req.VoucherNo)
|
tx = tx.Where("voucher_no IN (?)", req.VoucherNos)
|
||||||
}
|
}
|
||||||
|
|
||||||
var results = make([]*model.Order, 0)
|
var results = make([]*model.Order, 0)
|
||||||
|
|
|
||||||
|
|
@ -33,20 +33,20 @@ func (p *OrderBakRepoImpl) SpecifyFindInBatches(ctx context.Context, req *bo.Fin
|
||||||
tx = tx.Where("product_no = ?", req.ProductNo)
|
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)
|
tx = tx.Where("receive_success_time BETWEEN ? AND ?", req.StartTime, req.EndTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.OrderNo != nil {
|
if req.OrderNos != nil {
|
||||||
tx = tx.Where("order_no IN (?)", req.OrderNo)
|
tx = tx.Where("order_no IN (?)", req.OrderNos)
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.OutBizNo != nil {
|
if req.OutBizNos != nil {
|
||||||
tx = tx.Where("out_biz_no IN (?)", req.OutBizNo)
|
tx = tx.Where("out_biz_no IN (?)", req.OutBizNos)
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.VoucherNo != nil {
|
if req.VoucherNos != nil {
|
||||||
tx = tx.Where("voucher_no IN (?)", req.VoucherNo)
|
tx = tx.Where("voucher_no IN (?)", req.VoucherNos)
|
||||||
}
|
}
|
||||||
|
|
||||||
var results = make([]*model.OrderBak, 0)
|
var results = make([]*model.OrderBak, 0)
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,7 @@ func (this *CmbService) SpecifyNotification(ctx http.Context) error {
|
||||||
return fmt.Errorf("req is empty")
|
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")
|
return fmt.Errorf("out_biz_no or order_no or voucher_no is empty")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue