소스 검색

fix:画像优化逻辑修改

duxin 1 년 전
부모
커밋
59a2813a0e
1개의 변경된 파일5개의 추가작업 그리고 13개의 파일을 삭제
  1. 5 13
      entniche_new/src/service/portrait/subvipPortraitAction.go

+ 5 - 13
entniche_new/src/service/portrait/subvipPortraitAction.go

@@ -81,27 +81,20 @@ func (this *EntPortrait) BuyerNewMsg() {
 
 
 // 采购单位联系人
 // 采购单位联系人
 func (this *EntPortrait) BuyerContacts() {
 func (this *EntPortrait) BuyerContacts() {
-	qStart := time.Now()
 	userId := qutil.ObjToString(this.GetSession("userId"))
 	userId := qutil.ObjToString(this.GetSession("userId"))
 	rData, errMsg := func() (interface{}, error) {
 	rData, errMsg := func() (interface{}, error) {
-		cepm, hasPower, err := entity.CreatePortraitManager(this.Session())
+		cepm, _, err := entity.CreatePortraitManager(this.Session())
 		if err != nil {
 		if err != nil {
 			return nil, err
 			return nil, err
 		}
 		}
-		if false && !hasPower {
-			return nil, fmt.Errorf("非法请求")
-		}
 		buyerName := this.GetString("buyer")
 		buyerName := this.GetString("buyer")
 		qTime1 := time.Now()
 		qTime1 := time.Now()
 		err = entity.SubVipPortraitTimesCheck(Mysql, buyerName, userId)
 		err = entity.SubVipPortraitTimesCheck(Mysql, buyerName, userId)
 		if err != nil {
 		if err != nil {
 			return nil, err
 			return nil, err
 		}
 		}
-		log.Println("check耗时:", time.Since(qTime1))
-		qTime2 := time.Now()
 		rData, err := cepm.GetBuyerContactsMsg(buyerName)
 		rData, err := cepm.GetBuyerContactsMsg(buyerName)
-		log.Println("search耗时:", time.Since(qTime2))
-		log.Println("total耗时:", time.Since(qStart))
+		log.Println("search耗时:", time.Since(qTime1))
 
 
 		if err != nil {
 		if err != nil {
 			return nil, err
 			return nil, err
@@ -157,9 +150,6 @@ func (this *EntPortrait) BuyerPortrait() {
 			return nil, fmt.Errorf("参数异常")
 			return nil, fmt.Errorf("参数异常")
 		}
 		}
 		cepm, hasPower, err := entity.CreatePortraitManager(this.Session())
 		cepm, hasPower, err := entity.CreatePortraitManager(this.Session())
-		if false && err != nil {
-			return nil, fmt.Errorf("非法请求")
-		}
 		err = entity.SubVipPortraitTimesCheck(Mysql, buyerName, userId)
 		err = entity.SubVipPortraitTimesCheck(Mysql, buyerName, userId)
 		if err != nil {
 		if err != nil {
 			hasPower = false
 			hasPower = false
@@ -179,7 +169,9 @@ func (this *EntPortrait) BuyerPortrait() {
 		if err != nil {
 		if err != nil {
 			return nil, err
 			return nil, err
 		}
 		}
-		rData["name"] = buyerName
+		if rData != nil {
+			rData["name"] = buyerName
+		}
 		return rData, nil
 		return rData, nil
 	}()
 	}()
 	if errMsg != nil {
 	if errMsg != nil {