|
@@ -1203,18 +1203,23 @@ func (rg *RegisterController) InvoiceList(c *gin.Context) {
|
|
|
pars = append(pars, req.InvoiceType)
|
|
|
// 合同编号
|
|
|
if req.ContractCode != "" {
|
|
|
- cond += ` AND contract_code = ?`
|
|
|
- pars = append(pars, req.ContractCode)
|
|
|
+ kw := fmt.Sprint("%", req.ContractCode, "%")
|
|
|
+ cond += ` AND contract_code LIKE ?`
|
|
|
+ pars = append(pars, kw)
|
|
|
}
|
|
|
if req.StartDate != "" && req.EndDate != "" {
|
|
|
st := fmt.Sprint(req.StartDate, " 00:00:00")
|
|
|
ed := fmt.Sprint(req.EndDate, " 23:59:59")
|
|
|
- cond += ` AND (create_time BETWEEN ? AND ?)`
|
|
|
+ cond += ` AND (invoice_time BETWEEN ? AND ?)`
|
|
|
pars = append(pars, st, ed)
|
|
|
}
|
|
|
- if req.MinAmount > 0 && req.MaxAmount > 0 {
|
|
|
- cond += ` AND (amount BETWEEN ? AND ?)`
|
|
|
- pars = append(pars, req.MinAmount, req.MaxAmount)
|
|
|
+ if req.MinAmount > 0 {
|
|
|
+ cond += ` AND amount >= ?`
|
|
|
+ pars = append(pars, req.MinAmount)
|
|
|
+ }
|
|
|
+ if req.MaxAmount > 0 {
|
|
|
+ cond += ` AND amount <= ?`
|
|
|
+ pars = append(pars, req.MaxAmount)
|
|
|
}
|
|
|
|
|
|
page := new(base.Page)
|