Explorar el Código

Merge branch 'cygx_13.8' of http://8.136.199.33:3000/hongze/hongze_cygx into debug

xingzai hace 5 meses
padre
commit
9e7dd82f1c
Se han modificado 5 ficheros con 90 adiciones y 3 borrados
  1. 41 0
      controllers/ficc_report.go
  2. 11 2
      models/db.go
  3. 28 0
      models/ficc_report/yb_xcx_history.go
  4. 9 0
      routers/commentsRouter.go
  5. 1 1
      utils/config.go

+ 41 - 0
controllers/ficc_report.go

@@ -2,7 +2,10 @@ package controllers
 
 import (
 	"hongze/hongze_cygx/models"
+	"hongze/hongze_cygx/models/ficc_report"
 	"hongze/hongze_cygx/services"
+	"hongze/hongze_cygx/utils"
+	"time"
 )
 
 type FiccYbController struct {
@@ -51,3 +54,41 @@ func (this *FiccYbController) Detail() {
 	br.Msg = "获取成功"
 	br.Data = detail
 }
+
+// @Title 记录点击信息
+// @Description 记录点击信息
+// @Param	request	body cygx.CygxBannerIdReq true "type json string"
+// @Success 200 Ret=200 发布成功
+// @router /add/xcx/history [post]
+func (this *FiccYbController) AddXcxHistory() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	user := this.User
+	if user == nil {
+		br.Msg = "请登录"
+		br.ErrMsg = "请登录,用户信息为空"
+		br.Ret = 408
+		return
+	}
+	historyRecord := new(ficc_report.FiccYbXcxHistory)
+	historyRecord.UserId = user.UserId
+	historyRecord.RealName = user.RealName
+	historyRecord.CreateTime = time.Now()
+	historyRecord.Mobile = user.Mobile
+	historyRecord.Email = user.Email
+	historyRecord.CompanyId = user.CompanyId
+	historyRecord.CompanyName = user.CompanyName
+	historyRecord.RegisterPlatform = utils.REGISTER_PLATFORM
+	historyRecord.SellerName, _, _ = services.GetSellerName(user)
+	_, err := ficc_report.AddFiccYbXcxHistory(historyRecord)
+	if err != nil {
+		br.Msg = "记录访问信息失败"
+		br.ErrMsg = "记录访问信息失败" + err.Error()
+	}
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "记录成功"
+}

+ 11 - 2
models/db.go

@@ -2,6 +2,7 @@ package models
 
 import (
 	_ "github.com/go-sql-driver/mysql"
+	"hongze/hongze_cygx/models/ficc_report"
 	"hongze/hongze_cygx/models/order"
 	"hongze/hongze_cygx/models/rai_serve"
 	"hongze/hongze_cygx/utils"
@@ -193,8 +194,9 @@ func init() {
 		new(CygxActivitySpecialPermissionPoints),
 	)
 
-	initOrder()    // 订单模块
-	initRaiServe() // 权益服务记录模块
+	initOrder()      // 订单模块
+	initRaiServe()   // 权益服务记录模块
+	initFiccReport() // 权益服务记录模块
 
 	// 记录ORM查询日志
 	orm.Debug = true
@@ -223,3 +225,10 @@ func initRaiServe() {
 		new(rai_serve.CygxRaiCompanyUserBill), //权益正式,试用客户近四周互动记录统计表
 	)
 }
+
+// ficc研报
+func initFiccReport() {
+	orm.RegisterModel(
+		new(ficc_report.FiccYbXcxHistory), //ficc研报小程序点击记录
+	)
+}

+ 28 - 0
models/ficc_report/yb_xcx_history.go

@@ -0,0 +1,28 @@
+package ficc_report
+
+import (
+	"github.com/beego/beego/v2/client/orm"
+	"time"
+)
+
+type FiccYbXcxHistory struct {
+	Id               int `orm:"column(id);pk"`
+	UserId           int
+	CreateTime       time.Time
+	Mobile           string    `description:"手机号"`
+	Email            string    `description:"邮箱"`
+	CompanyId        int       `description:"公司id"`
+	CompanyName      string    `description:"公司名称"`
+	ModifyTime       time.Time `description:"修改时间"`
+	RealName         string    `description:"用户实际名称"`
+	SellerName       string    `description:"所属销售"`
+	RegisterPlatform int       `description:"来源 1小程序,2:网页"`
+}
+
+// 添加历史信息
+func AddFiccYbXcxHistory(item *FiccYbXcxHistory) (lastId int64, err error) {
+	o := orm.NewOrm()
+	item.ModifyTime = time.Now()
+	lastId, err = o.Insert(item)
+	return
+}

+ 9 - 0
routers/commentsRouter.go

@@ -781,6 +781,15 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:FiccYbController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:FiccYbController"],
+        beego.ControllerComments{
+            Method: "AddXcxHistory",
+            Router: `/add/xcx/history`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:FiccYbController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:FiccYbController"],
         beego.ControllerComments{
             Method: "Detail",

+ 1 - 1
utils/config.go

@@ -341,7 +341,7 @@ func ChartPermissionId() {
 	if RunMode == "release" {
 		ZHOU_QI_ID = 62
 	} else {
-		ZHOU_QI_ID = 138
+		ZHOU_QI_ID = 148
 	}
 }