Browse Source

Merge branch 'dev4.6.2.1' of http://192.168.3.207:8080/qmx/jy into dev4.6.2.1

熊啸云 3 năm trước cách đây
mục cha
commit
0e74b7ae2c

+ 39 - 0
src/jfw/modules/publicapply/src/subscribe/entity/entity.go

@@ -264,3 +264,42 @@ func getStringArrFromDbResult(area map[string]interface{}, i int) (arr []string)
 	}
 	return
 }
+
+/*是否需要到期弹窗提醒
+tip : true需要 false不需要
+area : 免费订阅的地区
+*/
+func (pi *ParamInfo) AreaPackTip() map[string]interface{} {
+	m := map[string]interface{}{
+		"tip":  false,
+		"area": "",
+	}
+	mData, ok := db.Mgo.FindById("user", pi.UserId, `{"o_jy":1}`)
+	if ok && mData != nil && len(*mData) != 0 {
+		o_jy, _ := (*mData)["o_jy"].(map[string]interface{})
+		if o_jy["i_areapackTip"] != nil {
+			if i_tip := qutil.IntAll(o_jy["i_areapackTip"]); i_tip == 1 {
+				m["tip"] = true
+			}
+		}
+		if o_jy["o_area"] != nil {
+			oarea, _ := o_jy["o_area"].(map[string]interface{})
+			if len(oarea) > 0 {
+				for k, _ := range oarea {
+					m["area"] = k
+					break
+				}
+			}
+		}
+	}
+	return m
+}
+
+//修改到期提醒状态
+func (pi *ParamInfo) UpdateAreaPackTip() bool {
+	return db.Mgo.UpdateById("user", pi.UserId, map[string]interface{}{
+		"$set": map[string]interface{}{
+			"o_jy.i_areapackTip": 0,
+		},
+	})
+}

+ 4 - 3
src/jfw/modules/publicapply/src/subscribe/service/action.go

@@ -6,7 +6,8 @@ import (
 
 type ServiceStruct struct {
 	*xweb.Action
-	subscribeMsg xweb.Mapper `xweb:"/free/subscribe"` //获取用户订阅信息
-	getPushCount xweb.Mapper `xweb:"/free/pushcount"` //推送结果预览 计数
-	getPushView  xweb.Mapper `xweb:"/free/pushview"`  //推送结果预览
+	subscribeMsg   xweb.Mapper `xweb:"/free/subscribe"`     //获取用户订阅信息
+	getPushCount   xweb.Mapper `xweb:"/free/pushcount"`     //推送结果预览 计数
+	getPushView    xweb.Mapper `xweb:"/free/pushview"`      //推送结果预览
+	areaPackEndTip xweb.Mapper `xweb:"/free/areapack/(.*)"` //省份订阅包到期提醒
 }

+ 16 - 0
src/jfw/modules/publicapply/src/subscribe/service/service.go

@@ -49,3 +49,19 @@ func (this *ServiceStruct) GetPushCount() {
 		})
 	}
 }
+
+func (this *ServiceStruct) AreaPackEndTip(types string) {
+	userId, _ := this.GetSession("userId").(string)
+	defer qu.Catch()
+	r := func() Result {
+		newFN := entity.NewParamInfo(userId)
+		switch types {
+		case "tip":
+			return Result{Data: newFN.AreaPackTip()}
+		case "update":
+			return Result{Data: newFN.UpdateAreaPackTip()}
+		}
+		return Result{Data: nil, Error_code: -1, Error_msg: "未知请求"}
+	}()
+	this.ServeJson(r)
+}

+ 2 - 1
src/jfw/modules/subscribepay/src/timetask/timetask.go

@@ -65,7 +65,8 @@ func updateProvincePackageStatus() {
 			_id := BsonIdToSId(m["_id"])
 			if util.MQFW.UpdateById("user", _id, map[string]interface{}{
 				"$set": map[string]interface{}{
-					"o_jy.i_ppstatus": -1,
+					"o_jy.i_ppstatus":    -1,
+					"o_jy.i_areapackTip": 1,
 				},
 			}) {
 				if !jy.ClearBigVipUserPower(_id) {

+ 1 - 1
src/web/templates/pc/myOrder.html

@@ -642,7 +642,7 @@
               icon: '/common-module/data-pack/images/shujubao.png'
             },
             '省份订阅包': {
-              icon: '/common-module/order-list/image/shujubao.png'
+              icon: '/common-module/order-list/image/sfdybao.png'
             }
           },
           bigIndexMap: {