ziwen 2 年之前
父节点
当前提交
8ecadf5d29
共有 2 个文件被更改,包括 7 次插入3 次删除
  1. 1 1
      controller/census/invoice_payment.go
  2. 6 2
      controller/contract/register.go

+ 1 - 1
controller/census/invoice_payment.go

@@ -578,7 +578,7 @@ func (ct *InvoicePaymentController) List(c *gin.Context) {
 			cond += ` AND (c.invoice_time BETWEEN ? AND ?) AND (d.invoice_time BETWEEN ? AND ?) `
 			pars = append(pars, st, ed, st, ed)
 		}
-	}else if req.StartDate != "" && req.EndDate != "" {
+	} else if req.StartDate != "" && req.EndDate != "" {
 		st := fmt.Sprint(req.StartDate, " 00:00:00")
 		ed := fmt.Sprint(req.EndDate, " 23:59:59")
 		cond += ` AND ((c.invoice_time BETWEEN ? AND ?) or (d.invoice_time BETWEEN ? AND ?))`

+ 6 - 2
controller/contract/register.go

@@ -1970,9 +1970,13 @@ func (rg *RegisterController) InvoiceList(c *gin.Context) {
 		pageIndex = 1
 	}
 
-	cond := `invoice_type = ?`
+	cond := ``
+	if req.InvoiceType == 1 {
+		cond = `invoice_type IN (1,3)`
+	} else {
+		cond = `invoice_type IN (2,4)`
+	}
 	pars := make([]interface{}, 0)
-	pars = append(pars, req.InvoiceType)
 	// 搜索
 	if req.Keyword != "" {
 		kw := fmt.Sprint("%", req.Keyword, "%")