|
@@ -42,9 +42,20 @@ func (ct *SellerController) GroupInvoiceList(c *gin.Context) {
|
|
|
resp.FailData("参数解析失败", err.Translate(global.Trans), c)
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+ var departmentId int
|
|
|
+ if req.SellerType == 1 {
|
|
|
+ departmentId = crm.SellerDepartmentId
|
|
|
+ }else if req.SellerType == 2 {
|
|
|
+ departmentId = crm.RaiSellerDepartmentId
|
|
|
+ }else if req.SellerType == 0 {
|
|
|
+ resp.Fail("请选择销售类型", c)
|
|
|
+ return
|
|
|
+ }else {
|
|
|
+ resp.Fail("请选择正确的销售类型", c)
|
|
|
+ return
|
|
|
+ }
|
|
|
outCond := ` department_id = %d AND parent_id = 0 `
|
|
|
- outCond = fmt.Sprintf(outCond, crm.SellerDepartmentId)
|
|
|
+ outCond = fmt.Sprintf(outCond, departmentId)
|
|
|
cond := ` invoice_type = %d AND is_deleted = 0 AND seller_group_id != 0 `
|
|
|
cond = fmt.Sprintf(cond, fms.ContractInvoiceTypeMake)
|
|
|
pars := make([]interface{}, 0)
|
|
@@ -199,12 +210,23 @@ func (ct *SellerController) InvoiceList(c *gin.Context) {
|
|
|
resp.FailData("参数解析失败", err.Translate(global.Trans), c)
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+ var departmentId int
|
|
|
+ if req.SellerType == 1 {
|
|
|
+ departmentId = crm.SellerDepartmentId
|
|
|
+ }else if req.SellerType == 2 {
|
|
|
+ departmentId = crm.RaiSellerDepartmentId
|
|
|
+ }else if req.SellerType == 0 {
|
|
|
+ resp.Fail("请选择销售类型", c)
|
|
|
+ return
|
|
|
+ }else {
|
|
|
+ resp.Fail("请选择正确的销售类型", c)
|
|
|
+ return
|
|
|
+ }
|
|
|
pars := make([]interface{}, 0)
|
|
|
outCond := ` a.department_id = %d AND a.enabled = 1 `
|
|
|
- outCond = fmt.Sprintf(outCond, crm.SellerDepartmentId)
|
|
|
+ outCond = fmt.Sprintf(outCond, departmentId)
|
|
|
totalCond := ` department_id = %d AND enabled = 1 `
|
|
|
- totalCond = fmt.Sprintf(totalCond, crm.SellerDepartmentId)
|
|
|
+ totalCond = fmt.Sprintf(totalCond, departmentId)
|
|
|
totalPars := make([]interface{}, 0)
|
|
|
if req.GroupId > 0 {
|
|
|
// 筛选组别时, 查询当前组别的下级组(因为admin表存的group_id, 有三级的存的是子ID, 只有二级的存的才是父ID =_=!)
|