zhangxinlei1996 1 жил өмнө
parent
commit
fcadd4742c

+ 3 - 0
handler/activity/task.go

@@ -103,6 +103,7 @@ func Task(msg *model.Message) {
 	//增加积分
 	mrpc.IntegralHarvest(msg.E_userId, gconv.Int64(num), code, msg.E_time)
 	//判断任务状态
+	fmt.Println(msg.E_userId, taskMsgMap[types], "===", taskMsgMap[types] == "")
 	if taskMsgMap[types] == "" {
 		//如果等于空证明没有初始化
 		db.Tidb.ExecTx("创建任务", func(tx *sql.Tx) bool {
@@ -139,9 +140,11 @@ func Task(msg *model.Message) {
 		//修改任务状态
 		taskId := ""
 		taskTypeArr := strings.Split(taskMsgMap[types], "_")
+		fmt.Println(msg.E_userId, types, "update", taskTypeArr)
 		if len(taskTypeArr) > 1 {
 			taskId = taskTypeArr[0]
 			status := taskTypeArr[1]
+			fmt.Println(msg.E_userId, status, "status", status == "0")
 			if status == "0" {
 				db.Tidb.Update("integral_task_detail", query, map[string]interface{}{
 					"status":      1,

+ 22 - 2
services/activity/task/task.go

@@ -28,6 +28,7 @@ type Task struct {
 	*xweb.Action
 	task             xweb.Mapper `xweb:"/task"`             //获取任务
 	confirmChallenge xweb.Mapper `xweb:"/confirmChallenge"` //确认挑战
+	tes              xweb.Mapper `xweb:"/tes"`
 }
 
 type TaskInfo struct {
@@ -146,7 +147,7 @@ func (this *Task) Task() {
 				dataM[model.FollowWx].Status = 1
 				dataM[model.FollowWx].FinishTime = now
 				activity.Task(&model.Message{
-					E_code:   "followWx",
+					E_code:   "task",
 					E_userId: userId,
 					E_time:   time.Now().Unix(),
 					E_app:    "jyweb_node2",
@@ -320,7 +321,7 @@ func (this *Task) ConfirmChallenge() {
 			l_registedate := gconv.Int64((*userMsg)["l_registedate"])
 			isNew := l_registedate > config.TaskConf.TaskStartTime //是否注册时间处于新手任务开始时间
 			ts := this.InitTask(isNew)
-			taskDetailCount := db.Tidb.CountBySql(`select count(1) from integral_task_detail where user_id =? and stauts=1`, baseUserId)
+			taskDetailCount := db.Tidb.CountBySql(`select count(1) from integral_task_detail where user_id =? and status=1`, baseUserId)
 			taskMsg := db.Tidb.SelectBySql(`select id from integral_task where user_id =? LIMIT 1`, baseUserId)
 			if taskMsg == nil || len(*taskMsg) == 0 {
 				return map[string]interface{}{"status": -1}, fmt.Errorf("任务创建失败")
@@ -360,3 +361,22 @@ func (this *Task) ConfirmChallenge() {
 	}
 	this.ServeJson(NewResult(rData, errMsg))
 }
+
+func (this *Task) Tes() {
+
+	d := mrpc.SubVipHarvest("65433cecbd1d69bdca017505", 7, "")
+	fmt.Println(d)
+	return
+	activity.Task(&model.Message{
+		E_code:   "task",
+		E_userId: "65433cecbd1d69bdca017505", //5ed6cii...
+		E_time:   1698800604,                 //1605223065
+		E_app:    "jyapp_node1",              //jywx_node1/jyweb_node2/jyapp_node1/jysubscribe
+		E_body: map[string]interface{}{
+			"baseUserId": 3755163,
+			"code":       1008,
+			"num":        50,
+			"positionId": 1205322910,
+			"types":      "followWx",
+		}})
+}

+ 2 - 1
services/filter/sessionfilter.go

@@ -1,8 +1,9 @@
 package filter
 
 import (
-	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 	"net/http"
+
+	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 )
 
 //登录限制