|
@@ -3750,6 +3750,7 @@ func BackOrderAuditList(context *admin.Context) (interface{}, error) {
|
|
OrderCode string `form:"orderCode"` //订单编号
|
|
OrderCode string `form:"orderCode"` //订单编号
|
|
SalePerson string `form:"salePerson"` // 销售人员
|
|
SalePerson string `form:"salePerson"` // 销售人员
|
|
AuditStatus string `form:"auditStatus"` // 订单审核状态
|
|
AuditStatus string `form:"auditStatus"` // 订单审核状态
|
|
|
|
+ SaleDep string `form:"saleDep"` //业绩归属部门
|
|
})
|
|
})
|
|
err := context.Form(param)
|
|
err := context.Form(param)
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -3758,14 +3759,17 @@ func BackOrderAuditList(context *admin.Context) (interface{}, error) {
|
|
condition := []string{
|
|
condition := []string{
|
|
"is_backstage_order=1",
|
|
"is_backstage_order=1",
|
|
}
|
|
}
|
|
|
|
+ if param.SaleDep != "" {
|
|
|
|
+ condition = append(condition, fmt.Sprintf(`condition = '%s'`, param.SaleDep))
|
|
|
|
+ }
|
|
if param.AuditStatus == "-1" {
|
|
if param.AuditStatus == "-1" {
|
|
// condition = append(condition, "audit_status !=0")
|
|
// condition = append(condition, "audit_status !=0")
|
|
- condition = append(condition, `(audit_status in (-2,-3,1,2,4) or (audit_status=3 and locate('"audit_type":"人工审核"', filter)>0))`)
|
|
|
|
|
|
+ condition = append(condition, `(audit_status in (-2,-3,-4,1,2,4) or (audit_status=3 and locate('"audit_type":"人工审核"', filter)>0))`)
|
|
} else if param.AuditStatus == "4" {
|
|
} else if param.AuditStatus == "4" {
|
|
- condition = append(condition, "audit_status in (-2,-3)")
|
|
|
|
|
|
+ condition = append(condition, "audit_status in (-2,-3,-4)")
|
|
|
|
|
|
} else if param.AuditStatus == "" {
|
|
} else if param.AuditStatus == "" {
|
|
- condition = append(condition, "audit_status in (1,2)")
|
|
|
|
|
|
+ condition = append(condition, "audit_status in (1,2,4)")
|
|
} else if param.AuditStatus == "3" {
|
|
} else if param.AuditStatus == "3" {
|
|
condition = append(condition, "audit_status =3")
|
|
condition = append(condition, "audit_status =3")
|
|
condition = append(condition, `locate('"audit_type":"人工审核"', filter)>0`)
|
|
condition = append(condition, `locate('"audit_type":"人工审核"', filter)>0`)
|
|
@@ -3785,11 +3789,17 @@ func BackOrderAuditList(context *admin.Context) (interface{}, error) {
|
|
if count != nil && len(*count) > 0 {
|
|
if count != nil && len(*count) > 0 {
|
|
q := fmt.Sprintf("select order_code,salesperson,audit_status,id,product_type,filter,vip_type, order_code as a ,\n (case WHEN last_update_time IS NULL THEN create_time else last_update_time end ) as create_time from dataexport_order where %s order by create_time limit %d ,%d", strings.Join(condition, " and "), param.Page.Offset, param.PageSize)
|
|
q := fmt.Sprintf("select order_code,salesperson,audit_status,id,product_type,filter,vip_type, order_code as a ,\n (case WHEN last_update_time IS NULL THEN create_time else last_update_time end ) as create_time from dataexport_order where %s order by create_time limit %d ,%d", strings.Join(condition, " and "), param.Page.Offset, param.PageSize)
|
|
res = util.JysqlDB.SelectBySql(q)
|
|
res = util.JysqlDB.SelectBySql(q)
|
|
|
|
+ showDeptMap := map[string]string{}
|
|
|
|
+ saleCodeD := util.JysqlDB.FindOne("dict_dep", map[string]interface{}{}, "", "")
|
|
|
|
+ if saleCodeD != nil && len(*saleCodeD) > 0 {
|
|
|
|
+ showDeptMap[qutil.ObjToString((*saleCodeD)["code"])] = qutil.ObjToString((*saleCodeD)["show"])
|
|
|
|
+ }
|
|
for i := 0; i < len(*res); i++ {
|
|
for i := 0; i < len(*res); i++ {
|
|
productType := qutil.ObjToString((*res)[i]["product_type"])
|
|
productType := qutil.ObjToString((*res)[i]["product_type"])
|
|
if productType == "大会员-AI中标预测包" || productType == "大会员-招标文件解读" {
|
|
if productType == "大会员-AI中标预测包" || productType == "大会员-招标文件解读" {
|
|
(*res)[i]["product_type"] = "大会员-补充包"
|
|
(*res)[i]["product_type"] = "大会员-补充包"
|
|
}
|
|
}
|
|
|
|
+ (*res)[i]["saleDep"] = showDeptMap[qutil.ObjToString((*res)[i]["saleDep"])]
|
|
}
|
|
}
|
|
data["total"] = (*count)[0]["count"]
|
|
data["total"] = (*count)[0]["count"]
|
|
} else {
|
|
} else {
|