|
@@ -1791,38 +1791,38 @@ func (rg *RegisterController) InvoiceList(c *gin.Context) {
|
|
|
pars = append(pars, kw)
|
|
|
// 开票列表同时模糊查询销售名称
|
|
|
if req.InvoiceType == fms.ContractInvoiceTypeMake {
|
|
|
- cond += ` AND (contract_code LIKE ? )`
|
|
|
+ cond += ` AND (a.contract_code LIKE ? )`
|
|
|
pars = append(pars, kw)
|
|
|
} else {
|
|
|
- cond += ` AND contract_code LIKE ?`
|
|
|
+ cond += ` AND a.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 (invoice_time BETWEEN ? AND ?)`
|
|
|
+ cond += ` AND (a.invoice_time BETWEEN ? AND ?)`
|
|
|
pars = append(pars, st, ed)
|
|
|
}
|
|
|
if req.MinAmount > 0 {
|
|
|
- cond += ` AND amount >= ?`
|
|
|
+ cond += ` AND a.amount >= ?`
|
|
|
pars = append(pars, req.MinAmount)
|
|
|
}
|
|
|
if req.MaxAmount > 0 {
|
|
|
- cond += ` AND amount <= ?`
|
|
|
+ cond += ` AND a.amount <= ?`
|
|
|
pars = append(pars, req.MaxAmount)
|
|
|
}
|
|
|
|
|
|
// 套餐类型
|
|
|
if req.ServiceProductId > 0 {
|
|
|
- cond += ` AND service_product_id = ?`
|
|
|
+ cond += ` AND a.service_product_id = ?`
|
|
|
pars = append(pars, req.ServiceProductId)
|
|
|
}
|
|
|
|
|
|
// 销售
|
|
|
if req.SellerIds != "" {
|
|
|
sellerIds := strings.Split(req.SellerIds, ",")
|
|
|
- cond += ` AND (seller_id in (?))`
|
|
|
+ cond += ` AND (a.seller_id in (?))`
|
|
|
pars = append(pars, sellerIds)
|
|
|
}
|
|
|
|