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