|
@@ -938,12 +938,12 @@ type CompanyNameList struct {
|
|
|
}
|
|
|
|
|
|
//获取客户名称列表数据
|
|
|
-func GetCompanyNameList(userId int, userRoleTypeCode, name string) (list []*CompanyNameList, err error) {
|
|
|
+func GetCompanyNameList(userId int, userRoleTypeCode, keyword string) (list []*CompanyNameList, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT a.company_name FROM company AS a
|
|
|
INNER JOIN company_product AS b ON a.company_id=b.company_id
|
|
|
INNER JOIN company_approval AS c ON b.company_id=c.company_id AND b.product_id=c.product_id
|
|
|
- WHERE (c.apply_user_id=? or ( (c.approve_user_id =? or c.approve_user_id = 0) and approve_role_type_code=?) ) and( a.company_name like '%` + name + `% or a.credit_code like '%` + name + `%)' group by a.company_name order by c.modify_time DESC `
|
|
|
+ WHERE (c.apply_user_id=? or ( (c.approve_user_id =? or c.approve_user_id = 0) and approve_role_type_code=?) ) and( a.company_name like '%` + keyword + `%' or a.credit_code like '%` + keyword + `%') group by a.company_name order by c.modify_time DESC `
|
|
|
_, err = o.Raw(sql, userId, userId, userRoleTypeCode).QueryRows(&list)
|
|
|
return
|
|
|
}
|