Browse Source

广告

master
huangjiajun 1 day ago
parent
commit
7046abf9f1
3 changed files with 8 additions and 5 deletions
  1. +6
    -3
      app/hdl/hdl_callback_advertising.go
  2. +1
    -1
      app/svc/svc_advertising.go
  3. +1
    -1
      go.mod

+ 6
- 3
app/hdl/hdl_callback_advertising.go View File

@@ -48,6 +48,7 @@ func CallbackChuanshanjia(c *gin.Context) {
sign := c.Query("sign")
extra := c.Query("extra")
id := gjson.Get(extra, "id").String()
uniqId := gjson.Get(extra, "uniqId").String()
phonePlatform := strings.ToLower(gjson.Get(extra, "platform").String())
platform := "chuanshanjia"
isEnd, spaceKey := comm(c, id, primeRit, platform, phonePlatform)
@@ -65,7 +66,7 @@ func CallbackChuanshanjia(c *gin.Context) {
c.String(200, "{\"is_verify\":true,\"reason\":50002}")
return
}
isEnds := commDoing(c, platform, transId, userId, extra, primeRit)
isEnds := commDoing(c, platform, transId, userId, extra, primeRit, uniqId)
if isEnds == 1 {
c.String(200, "{\"is_verify\":true,\"reason\":20000}")
return
@@ -81,6 +82,7 @@ func CallbackYoulianghui(c *gin.Context) {
sign := c.Query("sig")
extra := c.Query("extrainfo")
id := gjson.Get(extra, "id").String()
uniqId := gjson.Get(extra, "uniqId").String()
phonePlatform := strings.ToLower(gjson.Get(extra, "platform").String())
platform := "youlianghui"
isEnd, spaceKey := comm(c, id, primeRit, platform, phonePlatform)
@@ -98,7 +100,7 @@ func CallbackYoulianghui(c *gin.Context) {
c.String(200, "success")
return
}
isEnds := commDoing(c, platform, transId, userId, extra, primeRit)
isEnds := commDoing(c, platform, transId, userId, extra, primeRit, uniqId)
if isEnds == 1 {
c.String(200, "success")
return
@@ -108,7 +110,7 @@ func CallbackYoulianghui(c *gin.Context) {
}

// 公共处理
func commDoing(c *gin.Context, platform, transId, userId, extra, primeRit string) int {
func commDoing(c *gin.Context, platform, transId, userId, extra, primeRit, uniqId string) int {
types := gjson.Get(extra, "type").String()
exist, _ := db.Db.Where("platform=? and oid=?", platform, transId).Exist(&model.AdvertisingCallback{})
if exist {
@@ -121,6 +123,7 @@ func commDoing(c *gin.Context, platform, transId, userId, extra, primeRit string
Uid: utils.StrToInt(userId),
Extra: extra,
SpaceId: primeRit,
UniqId: uniqId,
CreateAt: time.Now(),
}
db.Db.Insert(&tmp)


+ 1
- 1
app/svc/svc_advertising.go View File

@@ -127,7 +127,7 @@ func AdvertisingState(c *gin.Context) {
}
isSuccess := "0"
var data model.AdvertisingCallback
db.Db.Where("oid=? ", req.Id).Get(&data)
db.Db.Where("uniq_id=? ", req.Id).Get(&data)
if data.Id > 0 {
isSuccess = "1"
}


+ 1
- 1
go.mod View File

@@ -32,7 +32,7 @@ require (
)

require (
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241202092326-afaf570d445a
code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241203101237-e13f870d5c93
code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241202080915-050246e21702
code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be
code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5


Loading…
Cancel
Save