|
@@ -135,29 +135,53 @@ func (this *Analysis) CsORRsList() {
|
|
|
if entName == "" {
|
|
|
log.Println("大会员初始化 企业名称有误-", userId)
|
|
|
}
|
|
|
- //客户
|
|
|
- if pcor == "C" {
|
|
|
- potComQ := PCQuery(area, industry, buyerClass, business_scope, sort_no, pcor)
|
|
|
- // log.Println("potComQ:", potComQ)
|
|
|
- regMap.Data = map[string]interface{}{
|
|
|
- "list": getPCostomers(userId, entName, potComQ, pcor),
|
|
|
- "param": map[string]interface{}{
|
|
|
- "area": area,
|
|
|
- "industry": industry,
|
|
|
- "buyerClass": buyerClass,
|
|
|
- "business_scope": business_scope,
|
|
|
- },
|
|
|
+ userInfo, ok := db.Mgo.FindById("user", userId, nil)
|
|
|
+ if ok && userInfo != nil && len(*userInfo) > 0 {
|
|
|
+ var i_member_status = qutil.IntAll((*userInfo)["i_member_status"])
|
|
|
+ var c_limitcount = 7
|
|
|
+ var r_limitcount = 7
|
|
|
+ if i_member_status == 4 {
|
|
|
+ bamount := getBAmountInfo(userId)
|
|
|
+ c_limitcount = qutil.IntAll(bamount["potential_customer_count"])
|
|
|
+ r_limitcount = qutil.IntAll(bamount["potential_rival_count"])
|
|
|
}
|
|
|
- } else if pcor == "R" {
|
|
|
- potRivQ := PCQuery(area, industry, buyerClass, business_scope, sort_no, pcor)
|
|
|
- regMap.Data = map[string]interface{}{
|
|
|
- "list": getPRivals(userId, potRivQ, pcor),
|
|
|
- "param": map[string]interface{}{
|
|
|
- "area": area,
|
|
|
- "industry": industry,
|
|
|
- "buyerClass": buyerClass,
|
|
|
- "business_scope": business_scope,
|
|
|
- },
|
|
|
+ //客户
|
|
|
+ if pcor == "C" {
|
|
|
+ potComQ := PCQuery(area, industry, buyerClass, business_scope, sort_no, pcor)
|
|
|
+ list := getPCostomers(userId, entName, potComQ, pcor)
|
|
|
+ surpluscount := -1 //剩余数量
|
|
|
+ if i_member_status == 4 {
|
|
|
+ surpluscount = len(list) - c_limitcount
|
|
|
+ list = list[:c_limitcount]
|
|
|
+ }
|
|
|
+ regMap.Data = map[string]interface{}{
|
|
|
+ "list": list,
|
|
|
+ "surpluscount": surpluscount,
|
|
|
+ "param": map[string]interface{}{
|
|
|
+ "area": area,
|
|
|
+ "industry": industry,
|
|
|
+ "buyerClass": buyerClass,
|
|
|
+ "business_scope": business_scope,
|
|
|
+ },
|
|
|
+ }
|
|
|
+ } else if pcor == "R" {
|
|
|
+ potRivQ := PCQuery(area, industry, buyerClass, business_scope, sort_no, pcor)
|
|
|
+ list := getPRivals(userId, potRivQ, pcor)
|
|
|
+ surpluscount := -1 //剩余数量
|
|
|
+ if i_member_status == 4 {
|
|
|
+ surpluscount = len(list) - r_limitcount
|
|
|
+ list = list[:r_limitcount]
|
|
|
+ }
|
|
|
+ regMap.Data = map[string]interface{}{
|
|
|
+ "list": list,
|
|
|
+ "surpluscount": surpluscount,
|
|
|
+ "param": map[string]interface{}{
|
|
|
+ "area": area,
|
|
|
+ "industry": industry,
|
|
|
+ "buyerClass": buyerClass,
|
|
|
+ "business_scope": business_scope,
|
|
|
+ },
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
regMap.Error_code = Error_code_1003
|