瀏覽代碼

修改credit

renzheng 9 年之前
父節點
當前提交
51176860c5

+ 8 - 6
core/src/qfw/mobile/wxmenu.go

@@ -189,12 +189,12 @@ func (m *Mobile) SwordfishPay() error {
 											PushType: mapPush,
 										}
 										clent.Call("PushInfo.PushMsg", &rpcData, &repl)
-										if errs == nil {
+										if errs == nil && repl == 1 {
 											//修改剑鱼占位值
 											credit.CheckSword(userId.(string), credit.A_JYSCTS, credit_a, m.Action)
 										}
 									}, func(e interface{}) {
-										log.Println("给用户推送出错", e)
+										log.Println("给用户推送出错", e)
 									})
 								}
 							}
@@ -280,7 +280,9 @@ func (m *Mobile) AjaxReq() error {
 					set["o_msgset."+v+".a_key"] = m.GetSlice(v + "_keys")
 					set["o_msgset."+v+".s_scope"] = m.GetString(v + "_scope")
 					set["o_msgset."+v+".l_modifydate"] = time.Now().Unix()
-					mapPush[v] = util.If(v == "bid", "中标", "招标").(string)
+					if switchstatus == 1 {
+						mapPush[v] = util.If(v == "bid", "中标", "招标").(string)
+					}
 				}
 			}
 			//更新数据库
@@ -288,7 +290,7 @@ func (m *Mobile) AjaxReq() error {
 			if mongodb.Update("user", `{"_id":"`+userId.(string)+`"}`, &map[string]interface{}{"$set": set}, false, false) {
 				flag = "y"
 				credit_a := util.IntAll(m.GetSession("credit_a"))
-				if !credit.AIsHasDo(credit.A_JYSCTS, credit_a) {
+				if !credit.AIsHasDo(credit.A_JYSCTS, credit_a) && len(mapPush) > 0 {
 					util.Try(func() {
 						//对用户进行推送
 						var repl int
@@ -299,12 +301,12 @@ func (m *Mobile) AjaxReq() error {
 							PushType: mapPush,
 						}
 						clent.Call("PushInfo.PushMsg", &rpcData, &repl)
-						if errs == nil {
+						if errs == nil && repl == 1 {
 							//修改剑鱼占位值
 							credit.CheckSword(userId.(string), credit.A_JYSCTS, credit_a, m.Action)
 						}
 					}, func(e interface{}) {
-						log.Println("给用户推送出错", e)
+						log.Println("给用户推送出错", e)
 					})
 				}
 			}

+ 1 - 2
core/src/timetask.json

@@ -1,2 +1 @@
-{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-01-22 15:44:25"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-22 15:44:25"}},"marketisstart":true,"marketrate":300}
-
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-01-22 16:40:29"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-22 16:40:29"}},"marketisstart":true,"marketrate":300}

+ 1 - 1
push/src/config.json

@@ -1 +1 @@
-{"bid":{"interval":60,"lastpushtime":"2015-10-10 10:10:10"},"bidStartTime":"2015-12-30 17:28:48","bidTitle":"亲!剑鱼为您速报最新鲜的中标信息啦","bidViewDomain":"192.168.3.132","durationMinutes":10,"fixPush":"oJULtwzXo6EFV1Ah-XeyRBimXGM8","mail_bid":"\u003cdiv\u003e%s\u003c/div\u003e,想了解更多信息,请访问http://www.qimingxing.info。","maxPushSize":50,"mgoAddr":"192.168.3.18:27080","mgoSize":10,"province":{"上海":9,"云南":25,"内蒙古":5,"北京":1,"台湾":32,"吉林":7,"四川":13,"天津":2,"宁夏":30,"安徽":12,"山东":15,"山西":4,"广东":19,"广西":20,"新疆":31,"江苏":10,"江西":14,"河北":3,"河南":16,"浙江":11,"海南":21,"湖北":17,"湖南":18,"澳门":34,"甘肃":28,"福建":13,"西藏":26,"贵州":24,"辽宁":6,"重庆":22,"陕西":27,"青海":29,"香港":33,"黑龙江":8},"pushInfoScopeDays":30,"rpcPort":"8766","smtpAddr":"smtp.exmail.qq.com","smtpFromUser":"企明星","smtpPort":465,"smtpPwd":"qy123456","smtpUser":"qyfw@topnet.net.cn","tenderStartTime":"2015-12-30 17:28:48","tenderTitle":"亲!剑鱼为您速报最新鲜的招标信息啦","weixinRpcServer":"127.0.0.1:82","weixin_bid":"\u003cdiv\u003e%s最新招标信息\u003c/div\u003e\u003cdiv\u003e%s\u003c/div\u003e","wxRpcRemark":"请到网站个人中心查看详细."}
+{"bid":{"interval":60,"lastpushtime":"2015-10-10 10:10:10"},"bidStartTime":"2015-12-30 17:28:48","bidTitle":"亲!剑鱼为您速报最新鲜的中标信息啦","bidViewDomain":"192.168.3.132","durationMinutes":10,"fixPush":"oJULtwzXo6EFV1Ah-XeyRBimXGM8","mail_bid":"\u003cdiv\u003e%s\u003c/div\u003e,想了解更多信息,请访问http://www.qimingxing.info。","maxPushSize":50,"mgoAddr":"192.168.3.18:27080","mgoSize":10,"province":{"上海":9,"云南":25,"内蒙古":5,"北京":1,"台湾":32,"吉林":7,"四川":13,"天津":2,"宁夏":30,"安徽":12,"山东":15,"山西":4,"广东":19,"广西":20,"新疆":31,"江苏":10,"江西":14,"河北":3,"河南":16,"浙江":11,"海南":21,"湖北":17,"湖南":18,"澳门":34,"甘肃":28,"福建":13,"西藏":26,"贵州":24,"辽宁":6,"重庆":22,"陕西":27,"青海":29,"香港":33,"黑龙江":8},"pushInfoScopeDays":50,"rpcPort":"8766","smtpAddr":"smtp.exmail.qq.com","smtpFromUser":"企明星","smtpPort":465,"smtpPwd":"qy123456","smtpUser":"qyfw@topnet.net.cn","tenderStartTime":"2015-12-30 17:28:48","tenderTitle":"亲!剑鱼为您速报最新鲜的招标信息啦","weixinRpcServer":"127.0.0.1:82","weixin_bid":"\u003cdiv\u003e%s最新招标信息\u003c/div\u003e\u003cdiv\u003e%s\u003c/div\u003e","wxRpcRemark":"请到网站个人中心查看详细."}

+ 5 - 1
push/src/qfw/push/cache.go

@@ -27,7 +27,11 @@ func InitCache(flag, m_openid string) map[string]*[]*MemberInterest {
 	cache := make(map[string]*[]*MemberInterest)
 	q := map[string]interface{}{}
 	if m_openid != "" {
-		q["s_m_openid"] = m_openid
+		q = map[string]interface{}{
+			"o_msgset." + flag + ".i_switchstatus": 1,
+			"o_msgset." + flag + ".i_status":       1,
+			"s_m_openid":                           m_openid,
+		}
 	} else {
 		fixPush := util.ObjToString(PushConfig["fixPush"])
 		if len(fixPush) > 5 {

+ 4 - 3
push/src/qfw/push/dopush/dopush.go

@@ -39,12 +39,11 @@ func (p *Pjob) DoPush(mopenid, stime string, opr int, ltime int64) bool {
 	p.Cache = new(map[string]*[]*push.MemberInterest)
 	*p.Cache = push.InitCache(p.Stype, mopenid)
 	p.CreateUserInterestWord()
-	EachAllBidInfo(p.Stype, "["+p.StypeName+"信息]", p.StypeName, ltime, p.MaxPushSize, p.Dfa, p.Cache, opr)
-	return true
+	return EachAllBidInfo(p.Stype, "["+p.StypeName+"信息]", p.StypeName, ltime, p.MaxPushSize, p.Dfa, p.Cache, opr)
 }
 
 //遍历数据并执行推送操作
-func EachAllBidInfo(stype, TITLEA, ShortTitle string, lastTime int64, MaxPushSize int, dfas *dfa.DFA, cache *map[string]*[]*push.MemberInterest, pushType int) {
+func EachAllBidInfo(stype, TITLEA, ShortTitle string, lastTime int64, MaxPushSize int, dfas *dfa.DFA, cache *map[string]*[]*push.MemberInterest, pushType int) (res bool) {
 	defer func() {
 		if r := recover(); r != nil {
 			fmt.Println("推送开始[E]", r)
@@ -105,8 +104,10 @@ L1:
 		kk := *k
 		vv := *v
 		time.Sleep(50 * time.Millisecond)
+		res = true
 		go Send(&kk, &vv, now, TITLEA, ShortTitle, stype, MaxPushSize)
 	}
+	return res
 }
 
 //全局推送功能

+ 2 - 2
weixin/src/config.json

@@ -24,9 +24,9 @@
         "loginTip":"您已经成功登录企明星,请在电脑端操作。",
         "freezeTip":"您的帐号已经冻结,请联系管理员。",
         "messagetpl":{
-                "identifytplid":"oGxkPyaV42z3KWykt58Tow9mBe_ImJvi8R3ajorVWOY",
+                "identifytplid":"sKn4r0or615ETYC-aI5OACPO_Q4-B8GYmgWoqcDghN4",
                 "offLinemsgtplid":"ExIeyFfoDNVJXhRDq09JbsjH_zbEJCB6gw6rxcV7atw",
-                "msgnotifytplid":"b7iuAMiTCIolnPhTdueKBVYThEMf2D-Bh2M_9v3J-68",
+                "msgnotifytplid":"fcke7PqteAtclzHV3ScdiePH48vxaH6M5aJF0O_7by8",
                 "managernotifytplid":"DIwMrPQToOhGfa6ZAQCCrqquzbLKajiXsKY0K_lQtWQ"
         },"activity":{
                 "activitycode":"topcj",