Kaynağa Gözat

edit customer qrcode image

abiao 4 yıl önce
ebeveyn
işleme
f4aeaa1997

+ 9 - 17
go/gopath/src/fohow.com/apps/controllers/customer_service_controller/customer_service_controller.go

@@ -2,6 +2,7 @@ package customer_service_controller
 
 import (
 	"fohow.com/apps"
+	"fohow.com/apps/models/ad_model"
 	"github.com/astaxie/beego/context"
 	//"fohow.com/libs/kefu"
 	//"github.com/astaxie/beego"
@@ -24,23 +25,14 @@ func (self *CustomerServiceController) Init(ctx *context.Context, controllerName
 }
 
 func (self *CustomerServiceController) GetRabbitKfImgByUnionid() {
-
-	// 2018/09/15这里先返回小兔二维码,不查询第五创
-	qrCodeImgUrl := "https://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/kf/kfewm.jpg"
-	//qrCodeImgUrl := "http://rabbit-mall.oss-cn-shenzhen.aliyuncs.com/xcx/kf/xcx_xiaola.jpg"
-	//wxUser := self.GetCurrentWxUser(true)
-	//if wxUser != nil{
-	//	result := kefu.GetKfQrcodeImgFromD5c(wxUser.Unionid)
-	//
-	//	if result!= nil && result.CheckCode == "0000"{
-	//
-	//		qrCodeImgUrl = result.ImgPath
-	//	}
-	//}
-	//
-	//if wxUser == nil{
-	//	beego.BeeLogger.Warn("wxUser not Login, cannot get QrcodeImgFromD5c!")
-	//}
+	adCode := "kf_qrcode"
+	qrCodeImgUrl := ""
+	_ads := ad_model.GetAdsByCode(adCode, true)
+	if _ads != nil {
+		qrCodeImgUrl = ad_model.GetFullImgUrl(_ads[0].Img)
+	} else {
+		qrCodeImgUrl = "https://fohow.oss-cn-shenzhen.aliyuncs.com/xcx/kf/kfewm.jpg"
+	}
 	self.Data["json"] = qrCodeImgUrl
 	self.ServeJSON()
 }