Ver Fonte

剑鱼修改

wangchuanjin há 9 anos atrás
pai
commit
f0a34c21db

+ 2 - 1
.gitignore

@@ -4,4 +4,5 @@
 */staticres/upload
 */src/src
 *.data
-*/timetask.json
+*/timetask.json
+core/src/timetask.json

+ 2 - 0
core/src/qfw/front/wxpush.go

@@ -16,9 +16,11 @@ type Wxpush struct {
 
 //推送列表
 func (w *Wxpush) WxpushList(s_m_openid string, _id string, msgid string) error {
+	/**
 	go func() {
 		mongodb.Update("message", `{"_id":"`+msgid+`"}`, `{"$set":{"i_status":1}}`, false, false)
 	}()
+	**/
 	w.T["data"] = *mongodb.FindById("wxpush", _id, `{"s_content":1,"s_words":1,"a_visitedindex":1,"a_publishtime":1,"s_type":1}`)
 	w.T["_id"] = _id
 	return w.Render("/wxpush/index.html", &w.T)

+ 1 - 0
core/src/qfw/member/member.go

@@ -33,6 +33,7 @@ type Member struct {
 	delLog             xweb.Mapper `xweb:"/mermber/delLog"`                    //删除日志
 	sendYearIdentCode  xweb.Mapper `xweb:"/front/sendYearIdentCode"`           //发送认证年报邮箱验证码
 	checkYearIdentCode xweb.Mapper `xweb:"/front/checkYearIdentCode"`          //验证输入的验证码
+	checkConMail       xweb.Mapper `xweb:"/member/accountset/checkConMail"`    //验证输入的邮箱是否是没认证的企业邮箱
 	//weixinCallBack     xweb.Mapper `xweb:"/weixinCallBack"`                    //微信授权后的回调地址
 	//qqCallBack         xweb.Mapper `xweb:"/qqCallBack"`                        //QQ授权后的回调地址
 }

+ 73 - 3
core/src/qfw/member/membermanager.go

@@ -79,13 +79,14 @@ func (m *Member) PromotionPage(v string) error {
 
 //自动审核通过
 func autoAuth(uid, uname, s_avatar, entid, promotion_id string) {
-	ent := FindById("enterprise", entid, `{"RegNo":1,"EntName":1,"s_action":1}`)
+	ent := FindById("enterprise", entid, `{"RegNo":1,"EntName":1,"s_action":1,"Nb_email":1}`)
 	if ent != nil {
 		s_action := ObjToString((*ent)["s_action"])
 		if len(s_action) == 2 { //已经认证过
 			return
 		}
 		entName := ObjToString((*ent)["EntName"])
+		email := ObjToString((*ent)["Nb_email"])
 		t := time.Now().Local().Unix()
 		doc := &map[string]interface{}{
 			"i_identificationway": 1,
@@ -96,11 +97,13 @@ func autoAuth(uid, uname, s_avatar, entid, promotion_id string) {
 			"s_submitname":           uname,
 			"s_submitid":             uid,
 			"s_enterprisename":       entName,
+			"s_enterpriseid":         entid,
 			"i_identificationstatus": 1,
 			"i_identificationtype":   1,
 			"s_piccard":              "",
 			"s_pic":                  "",
 			"l_submitdate":           t,
+			"s_mail":                 email,
 			"i_comauthenttype":       3,
 			"l_auditdate":            t,
 			"s_promotion":            promotion_id,
@@ -114,6 +117,7 @@ func autoAuth(uid, uname, s_avatar, entid, promotion_id string) {
 			data1["freezeremark"] = ""
 			data1["s_enterprisename"] = entName
 			data1["s_enterpriseid"] = entid
+			data1["i_comauthenttype"] = 3
 			data1["i_identificationway"] = 1 //user表默认=0,审核通过标志=1,审核不通过标志=-1,审核中标志=2
 			data1["i_identificationtype"] = 1
 			data1["s_role"] = "9" //权限设为企业管理员
@@ -784,11 +788,43 @@ func (m *Member) Setpwd() error {
 	}
 }
 
+//
+
+//验证输入的邮箱是否是没认证的企业邮箱
+func (m *Member) CheckConMail() error {
+	userId := m.GetSession("userId").(string)
+	var smail = m.GetString("checkmail")
+	var EntName = ""
+	var ac = ""
+	var id = ""
+	var uname = ""
+	var s_avatar = ""
+	pk := "1"
+	r := *FindOne("enterprise", M{"s_submitid": userId, "Nb_email": smail})
+	ac = r["s_action"].(string)
+	if len(r) > 0 && ac == "" {
+		EntName = r["EntName"].(string)
+		uname = m.GetSession("loginName").(string)
+		s_avatar = r["s_avatar"].(string)
+		pk = "2"
+		id = strings.Split(fmt.Sprintf("%s", r["_id"]), `"`)[1]
+	}
+	m.ServeJson(map[string]interface{}{
+		"pk":       pk,
+		"EntName":  EntName,
+		"id":       id,
+		"uname":    uname,
+		"s_avatar": s_avatar,
+	})
+	return nil
+
+}
+
 //绑定邮箱
 func (m *Member) Bindmail() error {
 	if m.Is("POST") {
 		var status string = "y"
-		var result, encryMail, isSetPwd string
+		var result, encryMail, isSetPwd, contype string
 		var count int
 		flag, _ := m.GetInt("flag")
 		mail := m.GetString("mail")
@@ -815,6 +851,16 @@ func (m *Member) Bindmail() error {
 			}
 		case 2: //校验验证码
 			if m.GetString("identCode") == m.GetSession("identCodeValue") {
+				//
+				contype = m.GetString("i_automatic")
+				entid := m.GetString("entid")
+				entname := m.GetString("entname")
+				avatar := m.GetString("avatar")
+				uname := m.GetString("uname")
+				usid := m.GetSession("userId").(string)
+				t := time.Now().Unix()
+				proid := fmt.Sprintf("%s", t)
+				//
 				m.DelSession("identCodeValue")
 				updateMap := make(M)
 				updateMap["s_email"] = mail
@@ -824,6 +870,30 @@ func (m *Member) Bindmail() error {
 				}
 				bol := Update("user", M{"_id": ObjectIdHex(m.GetSession("userId").(string))}, M{"$set": updateMap}, false, false)
 				if bol {
+					//邮箱绑定认证
+					if contype == "1" {
+						r := *FindById("enterprise", entid, nil)
+						ac := r["s_action"].(string)
+						if len(r) > 0 && ac == "" {
+							autoAuth(usid, uname, avatar, entid, proid)
+							//发系统消息
+							msg := &msg.Msg{
+								Msgtype:   1,
+								Title:     "年报邮箱绑定认证",
+								Content:   "您好,恭喜您的邮箱绑定并同时认证已经通过!",
+								ReceiveId: usid,
+							}
+							msg.SaveMsg()
+							//更改需求名称
+							Update("demand", M{"s_userid": usid}, M{"$set": M{"s_enterprisename": entname, "s_enterpriseid": entid, "i_identtype": 1}}, false, true)
+							demands := *Find("demand", M{"s_userid": usid}, nil, nil, false, -1, -1)
+							if demands != nil && len(demands) > 0 {
+								Try(func() {
+									elastic.UpdateNewDoc("demand", "demand", MapArrToObjArr(demands)...)
+								}, func(e interface{}) {})
+							}
+						}
+					}
 					UpdateCookieSession(m.Action, m.GetSession("loginType").(string), false, *FindById("user", m.GetSession("userId").(string), nil))
 					result = "y"
 				} else {
@@ -833,7 +903,7 @@ func (m *Member) Bindmail() error {
 				status = "identCode_error" //验证码错误
 			}
 		}
-		return m.Write(`{"flag":` + strconv.Itoa(int(flag+1)) + `,"status":"` + status + `","result":"` + result + `","encryMail":"` + encryMail + `","isSetPwd":"` + isSetPwd + `","count":` + strconv.Itoa(count) + `}`)
+		return m.Write(`{"flag":` + strconv.Itoa(int(flag+1)) + `,"status":"` + status + `","result":"` + result + `","encryMail":"` + encryMail + `","isSetPwd":"` + isSetPwd + `","contype":"` + contype + `","count":` + strconv.Itoa(count) + `}`)
 	} else {
 		return returnFront(m, "bindmail")
 	}

+ 8 - 0
core/src/qfw/member/message/swordfish.go

@@ -17,6 +17,14 @@ type swordfish struct {
 	*xweb.Action
 	swordfishlist xweb.Mapper `xweb:"/member/message/swordfishlist"` //剑鱼列表
 	setVisited    xweb.Mapper `xweb:"/member/message/setVisited"`    //已经访问过的列表
+	visitRedirect xweb.Mapper `xweb:"/visit/redirect"`               //剑鱼跳转访问请求,后续统计
+}
+
+func (s *swordfish) VisitRedirect() {
+	surl := s.GetString("url")
+	if surl != "" {
+		s.Redirect(surl)
+	}
 }
 
 func (s *swordfish) SetVisited() {

+ 2 - 1
core/src/qfw/search/searchService.go

@@ -338,7 +338,8 @@ func searhWebContentent(querymap map[string]string, n *Search, reqType string) (
 	          "match": {
 	            "enterprise.EntName": {
 	              "query":"` + keyword + `",
-	              "operator": "and"
+	              "operator": "and",
+				  "boost":2
 	            }
 	          }
 	        },

+ 1 - 1
core/src/timetask.json

@@ -1 +1 @@
-{"comment":{"c_rate":10,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2015-12-31 18:51:13"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2015-12-31 18:51:13"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":10,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-01-05 17:12:57"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-05 17:12:57"}},"marketisstart":true,"marketrate":300}

+ 2 - 2
core/src/web/templates/common/login.html

@@ -315,7 +315,7 @@ function afterLoginSkip(){
 						<div class="u-tipsok">
 								<h3>
 									<div class="f-username" style="float:left;"></div>
-									<div style="float:left;">恭喜你注册成功!<div>
+									<div style="float:left;">恭喜你注册成功!</div>
 								</h3>
 							</div>
 						</div>
@@ -339,7 +339,7 @@ function afterLoginSkip(){
 							<div class="u-tipsok">
 								<h3 style="line-height: 40px;margin: -25px 0 0 50px	;">
 									<div class="f-username"><span></span><img style="margin-left:15px;" src="/images/ent_authe_a.png" height="22"></div>
-									<div style="float:left;margin: -10px 0 30px 0; color:#000;">恭喜你注册成功!<div>
+									<div style="float:left;margin: -10px 0 30px 0; color:#000;">恭喜你注册成功!</div>
 								</h3>
 							</div>
 						</div>

+ 59 - 1
core/src/web/templates/member/accountset/bindmail.html

@@ -38,10 +38,31 @@
 				<div class="form-group">
 					<label class="col-md-1 control-label">邮箱</label>
 					<div class="col-md-4">
-				      <input type="text" name="mail" class="form-control" onkeyup="rePlaceSpace(this)" datatype="e" nullmsg="请输入你的邮箱" errormsg="邮箱格式错误" ajaxurl="/front/ajaxReq?oprType=checkMail">
+				      <input type="text" name="mail" class="form-control" onkeyup="rePlaceSpace(this)" onblur="ocheckMail()" id="ocheckmail" datatype="e" nullmsg="请输入你的邮箱" errormsg="邮箱格式错误" ajaxurl="/front/ajaxReq?oprType=checkMail">
 					</div>
 					<div class="col-md-7"><span class="Validform_checktip">请输入你的邮箱</span></div>
 				</div>
+				<div class="form-group hide" id="tishi1">
+					<label class="col-md-1 control-label"></label>
+					<div class="col-md-8">
+				      <span id="tishinr">“您绑定的是xxx公司在工商年报时登记的邮箱,您是否需要系统自动帮您完成企业实名认证,而无需上传营业执照?”</span>
+					</div>
+					<div class="col-md-3"></div>
+				</div>
+				<div class="form-group hide" id="tishi2">
+					<label class="col-md-2 control-label"></label>
+					<div class="col-md-1">
+				       <label>
+			              <input type="radio" name="i_automatic" value="1" id="i_automaticone"> 是
+			           </label>
+					</div>
+					<div class="col-md-1">
+					   <label>
+			              <input type="radio" name="i_automatic"  checked="checked" value="0" id="i_automatictwo"> 否
+			           </label>
+					</div>
+					<div class="col-md-7"><span class="Validform_checktip"></span></div>
+				</div>
 				<div class="form-group">
 					<label class="col-md-1 control-label">验证码</label>
 				    <div class="input-group col-md-4 checkCodeId">
@@ -63,6 +84,10 @@
 				</form>
 				<form class="form-horizontal accountForm hidden" id="step_2">
 				<input type="hidden" name="flag" value="2">
+				<input type="hidden" name="i_automatic" id="autotype" value="">
+				<input type="hidden" name="entid" id="entid" value="">
+				<input type="hidden" name="avatar" id="avatar" value="">
+				<input type="hidden" name="uname" id="uname" value="">
 				<input type="hidden" name="mail">
 				<div class="form-group">
 				    <label class="col-md-1 control-label" style="padding-top: 0px;">邮箱</label>
@@ -110,6 +135,33 @@
 <!-- 底部 -->
 {{include "/common/bottom.html"}}
 <script type="text/javascript">
+function ocheckMail(){
+	var checkmail = $("#ocheckmail").val();
+	$.post('/member/accountset/checkConMail',{checkmail:checkmail},function(data){
+		if (data.pk == "2")	{
+			$("#tishi1").removeClass("hide");
+			$("#tishi2").removeClass("hide");
+			$("#tishinr").html('“您绑定的是'+data.EntName+'公司在工商年报时登记的邮箱,您是否需要系统自动帮您完成企业实名认证,而无需上传营业执照?”');
+			var entid = data.id;
+			$("#entid").val(entid);
+			$("#uname").val(data.uname);
+			$("#avatar").val(data.s_avatar);
+		}
+		
+	})
+	
+	$("#i_automaticone").click(function (){
+		if($(this).is(":checked")){
+			if(checkmail!=""&&checkmail.length>0){
+				var st = $("input[name='i_automatic']:checked").val();
+				if (st == 1){	
+					$("#autotype").val("1");
+				}
+			}
+			
+		}
+	});
+}
 function currPos(){
    return [["用户中心","/member/show/memberindex"]]
 }
@@ -140,8 +192,14 @@ $(function(){
 					$("#step_3").removeClass("hidden");
 					if(data.result == "y"){
 						$("#bindmailSuccess").removeClass("hidden");
+						if(data.contype == 1){
+							$("#bindmailSuccess").append('<span>且年报邮箱已成功认证!</span>');
+						}
 					}else if(data.result == "n"){
 						$("#bindmailFail").removeClass("hidden");
+						if(data.contype == 0){
+							$("#bindmailFail").append('<span>且年报邮箱认证失败!</span>');
+						}
 					}
 				}
 			}else if(data.status == "mail_error"){

+ 2 - 5
core/src/web/templates/wxpush/index.html

@@ -101,11 +101,8 @@ function redirect(link){
 	if(!/^http/.test(link)){
 		link="http://"+link
 	}
-    var arg ='\u003cscript\u003etop.location.replace("'+link+'")\u003c/script\u003e';
-    var iframe = document.createElement('iframe');
-    iframe.src='javascript:window.name;';
-    iframe.name=arg;
-    document.body.appendChild(iframe);
+	window.location.href="/visit/redirect?url="+escape(link)
+
 }
 function setVisitedIndex(obj){
 	if(obj.hasClass("visited")){

+ 14 - 9
push/src/qfw/push/bid/bidpushjob.go

@@ -130,16 +130,13 @@ func send(k *push.MemberInterest, v *list.List, now time.Time, nowtime string) {
 	for ks := v.Front(); ks != nil; ks = ks.Next() {
 		k2 := *(ks.Value.(*map[string]interface{}))
 		i++
-		if firstTitle == "" {
+		if i == 1 {
 			firstTitle = strings.Replace(k2["title"].(string), "\n", "", -1)
+			lastInfoDate = k2["publishtime"].(int64)
 		}
 		str += "<div class='tslist'><span class='xh'>" + fmt.Sprintf("%d", i) + ".</span><a class='bt' target='_blank' href='" + k2["href"].(string) + "'>" + strings.Replace(k2["title"].(string), "\n", "", -1) + "</a></div>"
 		publishTimes[strconv.Itoa(i)] = k2["publishtime"]
 
-		date1 := k2["publishtime"].(int64)
-		if date1-lastInfoDate > 0 {
-			lastInfoDate = date1
-		}
 		if i >= MaxPushSize {
 			//限制最大信息条数
 			break
@@ -148,11 +145,19 @@ func send(k *push.MemberInterest, v *list.List, now time.Time, nowtime string) {
 	}
 	TITLE := TITLEA + fmt.Sprintf("%d条,关键词(%s)", i, strings.Join(k.Interest, ","))
 	WXTitle := fmt.Sprintf("%s《%s》%s", func() string {
-		minute := (now.Unix() - lastInfoDate) / 60
-		if minute > 120 || minute < 1 {
-			return ""
+		minute := now.Unix() - lastInfoDate
+		if minute > -1 && minute < 61 {
+			return fmt.Sprintf("%d秒前发布的", minute)
 		} else {
-			return fmt.Sprintf("%d分钟前发布的", minute)
+			minute = minute / 60
+			if minute > 121 {
+				return ""
+			} else {
+				if minute < 1 {
+					minute = 1
+				}
+				return fmt.Sprintf("%d分钟前发布的", minute)
+			}
 		}
 	}(), firstTitle, func() string {
 		if i == 1 {

+ 14 - 10
push/src/qfw/push/tender/tenderpushjob.go

@@ -128,16 +128,12 @@ func send(k *push.MemberInterest, v *list.List, now time.Time, nowtime string) {
 	for ks := v.Front(); ks != nil; ks = ks.Next() {
 		k2 := *(ks.Value.(*map[string]interface{}))
 		i++
-		if firstTitle == "" {
+		if i == 1 {
 			firstTitle = strings.Replace(k2["title"].(string), "\n", "", -1)
+			lastInfoDate = k2["publishtime"].(int64)
 		}
 		str += "<div class='tslist'><span class='xh'>" + fmt.Sprintf("%d", i) + ".</span><a class='bt' target='_blank' href='" + k2["href"].(string) + "'>" + strings.Replace(k2["title"].(string), "\n", "", -1) + "</a></div>"
 		publishTimes[strconv.Itoa(i)] = k2["publishtime"]
-
-		date1 := k2["publishtime"].(int64)
-		if date1-lastInfoDate > 0 {
-			lastInfoDate = date1
-		}
 		if i >= MaxPushSize {
 			//限制最大信息条数
 			break
@@ -146,11 +142,19 @@ func send(k *push.MemberInterest, v *list.List, now time.Time, nowtime string) {
 	}
 	TITLE := TITLEA + fmt.Sprintf("%d条,关键词(%s)", i, strings.Join(k.Interest, " "))
 	WXTitle := fmt.Sprintf("%s《%s》%s", func() string {
-		minute := (now.Unix() - lastInfoDate) / 60
-		if minute > 120 || minute < 1 {
-			return ""
+		minute := now.Unix() - lastInfoDate
+		if minute > -1 && minute < 61 {
+			return fmt.Sprintf("%d秒前发布的", minute)
 		} else {
-			return fmt.Sprintf("%d分钟前发布的", minute)
+			minute = minute / 60
+			if minute > 121 {
+				return ""
+			} else {
+				if minute < 1 {
+					minute = 1
+				}
+				return fmt.Sprintf("%d分钟前发布的", minute)
+			}
 		}
 	}(), firstTitle, func() string {
 		if i == 1 {

+ 0 - 4
weixin/src/config.json

@@ -28,10 +28,6 @@
 		"identifytplid":"sKn4r0or615ETYC-aI5OACPO_Q4-B8GYmgWoqcDghN4",
 		"offLinemsgtplid":"ExIeyFfoDNVJXhRDq09JbsjH_zbEJCB6gw6rxcV7atw",
 		"msgnotifytplid":"fcke7PqteAtclzHV3ScdiePH48vxaH6M5aJF0O_7by8",
-<<<<<<< HEAD
 		"managernotirytplid":"dplgu5Q644vzPdqcPXY7RqgItS3eXACmU1XDl27CvTA"
-=======
-		"managernotifytplid":"DIwMrPQToOhGfa6ZAQCCrqquzbLKajiXsKY0K_lQtWQ"
->>>>>>> 4923307c616d9c1f95b881ad75878f4d07df5134
 	}
 }

+ 11 - 35
weixin/src/qfw/weixin/menu.go

@@ -15,31 +15,10 @@ func CreateMenu(rw http.ResponseWriter, r *http.Request) {
 
 	menu := &Menu{make([]MenuButton, 3)}
 
-	menu.Buttons[0].Name = "领取红包"
-	menu.Buttons[0].Type = MenuButtonTypeUrl
-	menu.Buttons[0].Url = "http://mp.weixin.qq.com/s?__biz=MzA5MTk0MTk5Ng==&mid=401971726&idx=1&sn=89d2470f1de7e80975223041b06c106a#rd"
-	//
-	//menu.Buttons[0].Name = "关于我们"
-	//menu.Buttons[0].SubButtons = make([]MenuButton, 3)
-	//menu.Buttons[0].SubButtons[0].Name = "关于企明星"
-	//menu.Buttons[0].SubButtons[0].Type = MenuButtonTypeUrl
-	//menu.Buttons[0].SubButtons[0].Url = wf.SysConfig.Aboutmeurl
-	//menu.Buttons[0].SubButtons[1].Name = "联系我们"
-	//menu.Buttons[0].SubButtons[1].Type = MenuButtonTypeUrl
-	//menu.Buttons[0].SubButtons[1].Url = wf.SysConfig.Conactusurl
-	//menu.Buttons[0].SubButtons[2].Name = "微社区"
-	//menu.Buttons[0].SubButtons[2].Type = MenuButtonTypeUrl
-	//menu.Buttons[0].SubButtons[2].Url = wf.SysConfig.Wsqurl
-	//menu.Buttons[0].SubButtons[2].Name = "测试菜单"
-	//menu.Buttons[0].SubButtons[2].Type = MenuButtonTypeUrl
-	//menu.Buttons[0].SubButtons[2].Url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + wf.SysConfig.Appid + "&redirect_uri=http://" + wf.SysConfig.Domain + "/weixinoauth?action=viewtest&response_type=code&scope=snsapi_base&state=1#wechat_redirect"
-	//log.Println(menu.Buttons[0].SubButtons[2].Url)
+	menu.Buttons[0].Name = "剑鱼"
+	menu.Buttons[0].Type = MenuButtonTypeUrl ///search/enterprise/m_ent.html
+	menu.Buttons[0].Url = fmt.Sprintf(urlstr, "swordfishaction")
 
-	/**
-	menu.Buttons[1].Name = "企业会员认证"
-	menu.Buttons[1].Type = MenuButtonTypeKey
-	menu.Buttons[1].Key = "midentification"
-	**/
 	menu.Buttons[1].Name = "会员认证"
 	menu.Buttons[1].SubButtons = make([]MenuButton, 3)
 	menu.Buttons[1].SubButtons[0].Name = "企业认证"
@@ -57,20 +36,17 @@ func CreateMenu(rw http.ResponseWriter, r *http.Request) {
 	menu.Buttons[2].SubButtons[0].Name = "微官网"
 	menu.Buttons[2].SubButtons[0].Type = MenuButtonTypeKey
 	menu.Buttons[2].SubButtons[0].Key = "msite" //"http://" + wf.SysConfig.Domain + "/weixin/site/edit" //微官网编辑
-	menu.Buttons[2].SubButtons[1].Name = "剑鱼"
-	//menu.Buttons[2].SubButtons[1].Type = MenuButtonTypeKey
-	//menu.Buttons[2].SubButtons[1].Key = "swordfish" //剑鱼
+
+	menu.Buttons[2].SubButtons[1].Name = "企业查询"
 	menu.Buttons[2].SubButtons[1].Type = MenuButtonTypeUrl ///search/enterprise/m_ent.html
-	menu.Buttons[2].SubButtons[1].Url = fmt.Sprintf(urlstr, "swordfishaction")
+	menu.Buttons[2].SubButtons[1].Url = fmt.Sprintf(urlstr, "entsearchaction")
+	menu.Buttons[2].SubButtons[2].Name = "法规查询"
+	menu.Buttons[2].SubButtons[2].Type = MenuButtonTypeUrl
+	menu.Buttons[2].SubButtons[2].Url = fmt.Sprintf(urlstr, "lawsearchaction")
 
-	menu.Buttons[2].SubButtons[2].Name = "企业查询"
-	menu.Buttons[2].SubButtons[2].Type = MenuButtonTypeUrl ///search/enterprise/m_ent.html
-	//menu.Buttons[2].SubButtons[2].Url = "http://" + wf.SysConfig.Domain + "/search/enterprise/ent.html" //
-	menu.Buttons[2].SubButtons[2].Url = fmt.Sprintf(urlstr, "entsearchaction")
-	menu.Buttons[2].SubButtons[3].Name = "法规查询"
+	menu.Buttons[2].SubButtons[3].Name = "领取红包"
 	menu.Buttons[2].SubButtons[3].Type = MenuButtonTypeUrl
-	//menu.Buttons[2].SubButtons[3].Url = "http://" + wf.SysConfig.Domain + "/law/qfw/index" //
-	menu.Buttons[2].SubButtons[3].Url = fmt.Sprintf(urlstr, "lawsearchaction")
+	menu.Buttons[2].SubButtons[3].Url = "http://mp.weixin.qq.com/s?__biz=MzA5MTk0MTk5Ng==&mid=401971726&idx=1&sn=89d2470f1de7e80975223041b06c106a#rd"
 
 	err := Mux.CreateMenu(menu)
 	if err != nil {

+ 4 - 52
weixin/src/qfw/weixin/rpc/rpc.go

@@ -25,22 +25,14 @@ const (
 	//msgnotify_tplid = "b7iuAMiTCIolnPhTdueKBVYThEMf2D-Bh2M_9v3J-68" //消息提醒
 )
 
-<<<<<<< HEAD
-var identify_tplid, offLineMsg_tplid, msgnotify_tplid, managernotiry_tplid string
-=======
-var identify_tplid, offLineMsg_tplid, msgnotify_tplid, managerNotify_tplid string
->>>>>>> 4923307c616d9c1f95b881ad75878f4d07df5134
+var identify_tplid, offLineMsg_tplid, msgnotify_tplid, managernotify_tplid string
 
 //读取配置
 func InitTpl() {
 	identify_tplid = wf.SysConfig.MessageTpl["identifytplid"]
 	offLineMsg_tplid = wf.SysConfig.MessageTpl["offLinemsgtplid"]
 	msgnotify_tplid = wf.SysConfig.MessageTpl["msgnotifytplid"]
-<<<<<<< HEAD
-	managernotiry_tplid = wf.SysConfig.MessageTpl["managernotirytplid"]
-=======
-	managerNotify_tplid = wf.SysConfig.MessageTpl["managernotifytplid"]
->>>>>>> 4923307c616d9c1f95b881ad75878f4d07df5134
+	managernotify_tplid = wf.SysConfig.MessageTpl["managernotifytplid"]
 }
 
 func (wxrpc *WeiXinRpc) SendPushTplMsg(param *qrpc.NotifyMsg, ret *qrpc.RpcResult) (err error) {
@@ -126,8 +118,8 @@ func (wxrpc *WeiXinRpc) SendIdentifyTplMsg(param *qrpc.NotifyMsg, ret *qrpc.RpcR
 	return
 }
 
+//发送管理员通知
 func (wxrpc *WeiXinRpc) SendManagerNotifyMsg(param *qrpc.NotifyMsg, ret *qrpc.RpcResult) (err error) {
-	log.Println("tpl::", identify_tplid)
 	//构造自定义消息文本
 	var msg struct {
 		ToUser   string `json:"touser"`
@@ -150,7 +142,7 @@ func (wxrpc *WeiXinRpc) SendManagerNotifyMsg(param *qrpc.NotifyMsg, ret *qrpc.Rp
 		} `json:"data"`
 	}
 	msg.ToUser = param.Openid
-	msg.TplId = managerNotify_tplid
+	msg.TplId = managernotify_tplid
 	msg.Url = param.Url
 	msg.Data.Title.Value = param.Title
 	msg.Data.Detail.Value = param.Detail
@@ -206,46 +198,6 @@ func (wxrpc *WeiXinRpc) SendOffLineMsg(param *qrpc.NotifyMsg, ret *qrpc.RpcResul
 	return
 }
 
-//发送管理员通知
-func (wxrpc *WeiXinRpc) SendManagerNotifyMsg(param *qrpc.NotifyMsg, ret *qrpc.RpcResult) (err error) {
-	//构造自定义消息文本
-	var msg struct {
-		ToUser   string `json:"touser"`
-		TplId    string `json:"template_id"`
-		Url      string `json:"url"`
-		Topcolor string `json:"topcolor"`
-		Data     struct {
-			Title struct {
-				Value string `json:"value"`
-			} `json:"first"`
-			Detail struct {
-				Value string `json:"value"`
-			} `json:"keyword1"`
-			Result struct {
-				Value string `json:"value"`
-			} `json:"keyword2"`
-			Remark struct {
-				Value string `json:"value"`
-			} `json:"remark"`
-		} `json:"data"`
-	}
-	msg.ToUser = param.Openid
-	msg.TplId = managernotiry_tplid
-	msg.Url = param.Url
-	msg.Data.Title.Value = param.Title
-	msg.Data.Detail.Value = param.Detail
-	msg.Data.Result.Value = param.Result
-	msg.Data.Remark.Value = param.Remark
-
-	err = wxrpc.wx.PostTextCustom(tplapi_url, &msg)
-	if err != nil {
-		log.Println(err.Error())
-	} else {
-		log.Println("send tplmsg success!")
-	}
-	return
-}
-
 func StartWeixinRpc(wx *weixin.Weixin) {
 	wrpc := &WeiXinRpc{wx: wx}
 	//在此可以注册多个Rpc服务接口