Browse Source

修改剑鱼定时

renzheng 9 years ago
parent
commit
131cd8a1c2

+ 1 - 2
common/src/qfw/util/credit/credit.go

@@ -121,8 +121,7 @@ func UpuserCreditA(code, userId string, credit_a int) (bool, int) {
 		ret = 1 << (tmp - 1)
 	}
 	n_credit_a := uint64(credit_a) + ret
-	b := mogo.Update("user", `{"_id":"`+userId+`"}`, "{'$set':{'ss':'test','age':int64(n_credit_a)}}", true, false)
-	log.Println("gengxin", b)
+	b := mogo.Update("user", `{"_id":"`+userId+`"}`, &map[string]interface{}{"$set": &map[string]interface{}{"credit_a": int64(n_credit_a)}}, true, false)
 	return b, int(n_credit_a)
 }
 

+ 9 - 14
common/src/qfw/util/mongodb/mongodbutil_test.go

@@ -17,16 +17,16 @@ func Test_orAnd(t *testing.T) {
 	}
 }
 func Test_FindByQuery(t *testing.T) {
-	InitMongodbPool(1, "192.168.56.101", "test")
+	InitMongodbPool(1, "192.168.3.18:27080", "spider")
 	//查找单个
 	//var ss = FindOne("test1", "{'_id':'553306bce30454598ff1bc14'}")
-	log.Println(FindOne("test1", M{"name": "32432423zzzz"}))
-	log.Println("count", Count("test1", M{"name": "zzzz"}))
+	//log.Println(FindOne("test1", M{"name": "32432423zzzz"}))
+	//log.Println("count", Count("test1", M{"name": "zzzz"}))
 	//obj := map[string]interface{}{"name": "ggg555g32423zzzz"}
 	//log.Println(Save("test1", &obj))
-	log.Println((*(FindById("test1", "55330b77e30454598ff1bd6d", "{'_id':0}"))))
+	//log.Println((*(FindById("test1", "55330b77e30454598ff1bd6d", "{'_id':0}"))))
 	//查询多个
-	log.Println(Find("test1", "{'_id':'55330b77e30454598ff1bd6d'}", nil, "{'_id':0,'name':'1'}", true, -1, -1))
+	//log.Println(Find("test1", "{'_id':'55330b77e30454598ff1bd6d'}", nil, "{'_id':0,'name':'1'}", true, -1, -1))
 	//log.Println(Find("test1", "{'name':{'$regex':'1ss$'}}", nil, "{'_id':0,'name':'1'}", false, 1, 2))
 	//统计
 	//log.Println(Count("test1", "{'name':{'$regex':'^1ss'}}"))
@@ -35,15 +35,10 @@ func Test_FindByQuery(t *testing.T) {
 	//删除
 	//log.Println(Del("test1", "{'name':'AAA'}"))
 	//更新
-	//log.Println(Update("test1", "{'name':'1ss'}", "{'$set':{'ss':'test','age':100}}", false, false))
-	b := make([]M, 2)
-	b[0] = M{
-		"name": "zzzz",
-	}
-	b[1] = M{
-		"name": "bbbb",
-	}
-	_ = b
+
+	b := Update("test1", "{'_id':'56a0917ee49c13d5314daa0f'}", &map[string]interface{}{"$set": &map[string]interface{}{"credit_a": int64(2305843009213693695)}}, true, false)
+	//b := Update("test1", "{'_id':'56a0917ee49c13d5314daa0f'}", &map[string]interface{}{"age": "1"}, true, false)
+	log.Println("ssssssss", b)
 	//批量插入
 	//log.Println(SaveBulk("test1", b...))
 }

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

@@ -1081,6 +1081,7 @@ func returnFront(m *Member, key string) error {
 
 //更新cookie sessoin
 func UpdateCookieSession(action *xweb.Action, loginType string, flag bool, r map[string]interface{}) {
+	log.Println(r)
 	freeze := IntAll(r["i_freeze"])
 	action.Session().Set("i_freeze", freeze)
 	if r["s_nickname"] == nil || r["s_nickname"].(string) == "" {
@@ -1119,7 +1120,7 @@ func UpdateSession(action *xweb.Action, r map[string]interface{}) {
 		if r["s_nickname"] != nil && r["s_nickname"].(string) != "" {
 			setSessMap["nickName"] = r["s_nickname"]
 		}
-		setSessMap["userId"] = r["_id"]
+		setSessMap["userId"] = BsonIdToSId(r["_id"])
 		setSessMap["s_m_openid"] = r["s_m_openid"]
 		setSessMap["userType"] = IntAllDef(r["i_type"], 2)
 		setSessMap["userInfo"] = &r
@@ -1159,7 +1160,7 @@ func UpdateSession(action *xweb.Action, r map[string]interface{}) {
 		action.SetSession("identWay", IntAll(r["i_identificationway"]))   //认证状态
 		action.SetSession("opLocDistrict", r["opLocDistrict"])            //行政区划代码
 		**/
-		action.Session().UpdateByCustomField("id", r["_id"], "", &setSessMap)
+		action.Session().UpdateByCustomField("id", BsonIdToSId(r["_id"]), "", &setSessMap)
 	}, func(e interface{}) {
 		log.Println("登录报错", e)
 	})

+ 14 - 3
core/src/qfw/search/searchService.go

@@ -158,7 +158,6 @@ func (n *Search) GetEnterpriseList(reqType, param /*参数*/ string) error {
 			userId := ObjToString(n.GetSession("userId"))
 			if len(userId) > 0 {
 				credit_a := IntAll(n.GetSession("credit_a"))
-				log.Println(credit.AIsHasDo(credit.A_QYCX, credit_a))
 				if credit.AIsHasDo(credit.A_QYCX, credit_a) {
 					credit.UpuserCreditSession(userId, credit.B_QYCX, "B", nil, n.Action)
 				} else {
@@ -188,6 +187,18 @@ func (n *Search) GetEnterpriseList(reqType, param /*参数*/ string) error {
 //即时搜索
 func (n *Search) Sim() error {
 	keyword := n.GetString("words")
+	//查询送积分
+	userId := ObjToString(n.GetSession("userId"))
+	if len(userId) > 0 && len(keyword) > 0 {
+		credit_a := IntAll(n.GetSession("credit_a"))
+		if credit.AIsHasDo(credit.A_QYCX, credit_a) {
+			credit.UpuserCreditSession(userId, credit.B_QYCX, "B", nil, n.Action)
+		} else {
+			credit.UpuserCreditSession(userId, credit.A_QYCX, "A", nil, n.Action)
+			credit.UpuserCreditSession(userId, credit.B_QYCX, "B", nil, n.Action)
+		}
+	}
+
 	str := `{
 	          "match": {
 	            "enterprise.EntName": {
@@ -325,7 +336,7 @@ func searhWebContentent(querymap map[string]string, n *Search, reqType string) (
 						      }
 						    }
 						  }
-						,"_source":["_id","EntName","RegOrgName","RegNo","EntType","LeRep","EstDate","OpLocDistrictName","OpStateName","OpState","s_servicenames","s_action","OpLocDistrict"]
+						,"_source":["_id","EntName","RegOrgName","RegNo","EntType","LeRep","EstDate","OpLocDistrictName","RegCap","OpStateName","OpState","s_servicenames","s_action","OpLocDistrict"]
 						,"from":0,
 						"size":` + fmt.Sprintf("%v", perPage) + `,
 						  "sort": [{"_score": "desc"},{"OpSint":"desc"},{"RegCap":"desc"}]
@@ -470,7 +481,7 @@ func searhWebContentent(querymap map[string]string, n *Search, reqType string) (
 			"s_synopsis":{"force_source": true},
 			"stock":{"force_source": true}
         }
-    },"_source":["_id","EntName","RegOrgName","RegNo","EntType","LeRep","EstDate","OpLocDistrictName","OpStateName","OpState","s_servicenames","s_action","OpLocDistrict","s_submitid"]
+    },"_source":["_id","EntName","RegOrgName","RegNo","EntType","LeRep","EstDate","OpLocDistrictName","RegCap","OpStateName","OpState","s_servicenames","s_action","OpLocDistrict","s_submitid"]
 	,"from":` + fmt.Sprintf("%v", ((currentPage-1)*perPage)) + `,
 	"size":` + fmt.Sprintf("%v", perPage) +
 			`,"sort":[` + sort + `] }`

+ 1 - 1
core/src/qfw/yellowpage/yellowpagemanager.go

@@ -133,7 +133,7 @@ func (yp *Yellowpage) EnterpriseInfo(id string) error {
 			yp.T["res"] = info
 			contentuser, erruser := yp.Render4Cache("/yellowpage/enterpriseinfo.html", &yp.T)
 			if erruser == nil {
-				redis.PutBytes("enterprise", id, &contentuser, 7*ONEDAY)
+				redis.PutBytes("enterprise", "enterpriseInfo_"+id, &contentuser, 7*ONEDAY)
 			}
 			return yp.SetBody(contentuser)
 		} else {

+ 2 - 1
core/src/timetask.json

@@ -1 +1,2 @@
-{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-01-21 17:20:57"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-21 17:20:57"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-01-21 17:20:57"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-21 17:20:57"}},"marketisstart":true,"marketrate":300}
+

+ 7 - 33
core/src/web/staticres/css/dev-qfw.css

@@ -2,7 +2,7 @@
 body {
 	padding-top: 0px;
 	font-family: tahoma, arial, 'Hiragino Sans GB', 'Microsoft YaHei', 宋体, sans-serif;
-	color: #666;
+	color: #4e5051;
 }
 .h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6{
 	font-family: tahoma, arial, 'Hiragino Sans GB', 'Microsoft YaHei', 宋体, sans-serif;
@@ -1511,38 +1511,9 @@ a{
 	color: #D03102;
 	margin-right: 5px;
 }
-.d-bg-green{
-	background-image:url(/images/tbn8.png);
-}
-.d-bg-gray{
-	background-image:url(/images/tbn8.png);
-}
-.d-bg-blue{
-	background-image:url(/images/tbn7.png);
-}
-.a-bg-gray-new{
-	display:inline-block;
-	height:21px;
-	width:81px;
-	background:#FFF;
-	background-image:url(/images/tbn9.png);
-	position: relative;
-  	  top: -4px;
-}
-.d-bg-green, .d-bg-gray,.d-bg-blue{
-	width:81px;
-	height:21px;
-	color:#FFF;
-	padding-left:0px;;
-	position: static !important;
-	left: 0px;
-	right: 0px;
-	bottom: 0px;
-	text-overflow: none;
-	overflow: none;
-	white-space: nowrap;
-	line-height:21px !important;
-}
+
+style="color:#D03102;margin-right:5px;"
+
 .a-servicedetail #no_reg{ 
 	margin-bottom:100px; 
 	margin-top:50px;
@@ -2622,6 +2593,9 @@ a{
 	vertical-align: top;
 	padding: 10px 20px;
 }
+.b-disabled{
+	color: #A0A0A0;
+}
 /*认证完第一次登录 end*/
 /*分辨率小于1200的时候调整布局,算上滚动条1217*/
 @media (max-width: 1217px) {

+ 0 - 15
core/src/web/staticres/js/qfw.js

@@ -445,12 +445,6 @@ function isNullObj(obj){
 //根据id去后台查询评论个数、投标状态
 function advertAjaxRqe(position){
 	var data = "position="+position;
-	$("#hotService ul").each(function(){
-		var id = $(this).attr("data-id");
-		if(id != ""){
-			data += "&serviceId="+id;
-		}
-	});
 	$("#hotDemand>div").each(function(){
 		var id = $(this).attr("data-id");
 		if(id != ""){
@@ -459,15 +453,6 @@ function advertAjaxRqe(position){
 	});
 	if(data != ""){
 		$.post("/front/advertAjaxRqe",data,function(r){
-			if(r.service){
-				var service = r.service;
-				for(var i in service){
-					$('#hotService [data-id="'+service[i].id+'"]>.a-com-last').children("font").text(service[i].comments?service[i].comments:0);
-					if(service[i].online == "y"){
-						$('#hotService [data-id="'+service[i].id+'"]>.a-com-name>i').addClass("text-primary")
-					}
-				}
-			}
 			if(r.demand){
 				var demand = r.demand;
 				for(var i in demand){

+ 1 - 6
core/src/web/templates/common/hotservice.html

@@ -14,9 +14,4 @@
 		</li>
 	</ul>
 	{{end}}
-</div>
-<script type="text/javascript">
-$(function(){
-	advertAjaxRqe("hotService");
-});
-</script>
+</div>

+ 23 - 1
core/src/web/templates/index.html

@@ -251,7 +251,7 @@
 		<ul>
 		{{range $k,$v:=.T.sfdata}}
 		{{ if lt $k 8}}
-		<li><span></span><span><a target="_blank" href="{{index $v "href"}}"/>{{index $v "title"}}</a></span><span style="float:right;">{{if (index $v "publishtime")}}{{index $v "publishtime"}}{{else}}------{{end}}</span></li>
+		<li><span></span><span><a target="_blank" href="javascript:void(0);" class="reload" src="{{index $v "href"}}"/>{{index $v "title"}}</a></span><span style="float:right;">{{if (index $v "publishtime")}}{{index $v "publishtime"}}{{else}}------{{end}}</span></li>
 		{{if ge $k 3}}
 		{{if lt $k 4}}
 		</ul>
@@ -309,6 +309,28 @@
 </div>
 {{include "/common/bottom.html"}}
 <script>
+$(function(){
+var areload=$("a.reload");
+areload.click(function(){
+	var h=$(this).attr("src");
+	open_window(h);
+	return false;
+})
+})
+function redirect(link){ 
+	if(!/^http/.test(link)){
+		link="http://"+link
+	}
+	window.location.href="/visit/redirect?url="+escape(link)
+
+}
+function open_window(link){
+	if(!/^http/.test(link)){
+		link="http://"+link
+	}
+    var arg = '\u003cscript\u003elocation.replace("'+link+'")\u003c/script\u003e';
+    window.open('javascript:window.name;', arg);
+}
 $(".bmzhsk").mouseover(function(){
 	$(".index-new-bmrzqy").addClass("hidden");
 	$(".index-new-bmjy").addClass("hidden");

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

@@ -97,7 +97,7 @@
 					<label class="col-md-1 control-label">验证码</label>
 					<div class="input-group col-md-4 checkCodeId">
 						<input type="text" name="identCode" class="form-control" onkeyup="rePlaceUnDigital(this)" datatype="n6" maxlength="6" nullmsg="请输入邮箱验证码" errormsg="邮箱验证码格式错误" ajaxurl="/front/ajaxReq?oprType=checkIdentCode">
-						<span class="input-group-addon"><div id="sendIdentCodeBtn" class="sendIdentCodeBtn">获取邮箱验证码</div></span>
+						<span id="sendIdentCodeBtn" class="input-group-addon" style="width:96px;">获取邮箱验证码</span>
 					</div>
 					<div class="col-md-7"><span class="Validform_checktip">请输入邮箱验证码</span></div>
 				</div>

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

@@ -71,7 +71,7 @@
 					<label class="col-md-1 control-label">验证码</label>
 					<div class="input-group col-md-4 checkCodeId">
 						<input type="text" name="identCode" class="form-control" onkeyup="rePlaceUnDigital(this)" datatype="n6" maxlength="6" nullmsg="请输入短信验证码" errormsg="请输入短信验证码" ajaxurl="/front/ajaxReq?oprType=checkIdentCode">
-						<span class="input-group-addon"><div id="sendIdentCodeBtn" class="sendIdentCodeBtn">获取短信验证码</div></span>
+						<span id="sendIdentCodeBtn" class="input-group-addon" style="width:96px;">获取短信验证码</span>
 					</div>
 					<div class="col-md-7"><span class="Validform_checktip">请输入短信验证码</span></div>
 				</div>

+ 2 - 2
core/src/web/templates/member/accountset/updatephone.html

@@ -78,7 +78,7 @@
 						<label class="col-md-2 control-label">短信验证码</label>
 						<div class="input-group col-md-4 checkCodeId">
 							<input type="text" class="form-control" name="oldIdentCode" onkeyup="rePlaceUnDigital(this)" datatype="n6" maxlength="6" nullmsg="请输入短信验证码" errormsg="短信验证码格式错误" ajaxurl="/front/ajaxReq?oprType=checkOldIdentCode">
-							<span class="input-group-addon"><div class="sendIdentCodeBtn" id="sendIdentCodeBtn_old">获取短信验证码</div></span>
+							<span id="sendIdentCodeBtn_old" class="input-group-addon" style="width:96px;">获取短信验证码</span>
 						</div>
 						<div class="col-md-6"><span class="Validform_checktip">请输入短信验证码</span></div>
 					</div>
@@ -126,7 +126,7 @@
 						<label class="col-md-2 control-label">短信验证码</label>
 						<div class="input-group col-md-4 checkCodeId">
 							<input type="text" class="form-control" name="newIdentCode" onkeyup="rePlaceUnDigital(this)" datatype="n6" maxlength="6" nullmsg="请输入短信验证码" errormsg="短信验证码格式错误" ajaxurl="/front/ajaxReq?oprType=checkIdentCode">
-							<span class="input-group-addon"><div id="sendIdentCodeBtn_new" class="sendIdentCodeBtn">获取短信验证码</div></span>
+							<span id="sendIdentCodeBtn_new" class="input-group-addon" style="width:96px;">获取短信验证码</span>
 						</div>
 						<div class="col-md-6"><span class="Validform_checktip">请输入短信验证码</span></div>
 					</div>

+ 4 - 0
core/src/web/templates/member/editenterprise.html

@@ -239,6 +239,10 @@ function btnSaveForm(){
 		url: "/member/yellowpage/dosave/enterprise",
 		ajaxPost:true,
 		callback:function(data){
+		if(data == null || data == "" || typeof(data.info) == "undefined"){
+			window.location.href = "/";
+			return;
+		}
    		alert(data.info);		
 		window.location.href="/member/yellowpage/show/enterprise/"+ $entid;	
 		}

+ 13 - 8
core/src/web/templates/search/enterpriseList.html

@@ -103,22 +103,27 @@
 										{{end}}
 									{{end}}
 									<div class="margin-t-10">
-										<span>注册号:<small  class="lineb " >{{index $v "RegNo"}}</small></span>
+										<span><font class="b-disabled">注册号:</font><font  class="lineb " >{{index $v "RegNo"}}</font></span>
 										{{if index $v "EntType"}}
 											{{if eq $v.EntType "9600"}}
-												<span class="margin-l-15">经营者:<small  class="lineb " >{{index $v "LeRep"}}</small></span>
+												<span class="margin-l-15"><font class="b-disabled">经营者:</font><font  class="lineb " >{{index $v "LeRep"}}</font></span>
 											{{else if eq $v.EntType "5810"}}
-												<span class="margin-l-15">负责人:<small  class="lineb " >{{index $v "LeRep"}}</small></span>
+												<span class="margin-l-15"><font class="b-disabled">负责人:</font><font  class="lineb " >{{index $v "LeRep"}}</font></span>
 											{{else}}
-												<span class="margin-l-15">法定代表人:<small  class="lineb " >{{index $v "LeRep"}}</small></span>
+												<span class="margin-l-15"><font class="b-disabled">法定代表人:</font><font  class="lineb " >{{index $v "LeRep"}}</font></span>
+											{{end}}
+										{{end}}
+										{{if index $v "RegCap"}}
+											{{if and (ne $v.EntType "9600") (ne $v.EntType "5810")}}
+												<span class="margin-l-15"><font class="b-disabled">注册资本:</font><font  class="lineb " ><script>var d1={{$v.EntType}};d1=d1?d1:0; var lenD1=(d1+"").length ;if(lenD1>4&&(d1+"").indexOf(".")>-1&&(lenD1-(d1+"").indexOf("."))>4){document.write(d1.toFixed(4))}else{document.write(d1)}</script>万元</font></span>
 											{{end}}
 										{{end}}
 										<br>
-										<span>成立日期:<small  class="lineb " >{{index $v "EstDate"}}</small></span>
-										<span class="margin-l-15">所在地:<small  class="lineb " >{{index $v "OpLocDistrictName"}}</small></span>
+										<span><font class="b-disabled">成立日期:</font><font  class="lineb " >{{index $v "EstDate"}}</font></span>
+										<span class="margin-l-15"><font class="b-disabled">所在地:</font><font  class="lineb " >{{index $v "OpLocDistrictName"}}</font></span>
 									</div>
-									{{if $v.stock }}<div>股东:<small  class="lineb ">{{index $v "stock"}}</small></div>{{end}}
-									{{if $v.OpScope }}<div>经营范围:<small  class="lineb ">{{index $v "OpScope"}}</small></div>{{end}}
+									{{if $v.stock }}<div><font class="b-disabled">股东:</font><font  class="lineb ">{{index $v "stock"}}</font></div>{{end}}
+									{{if $v.OpScope }}<div><font class="b-disabled">经营范围:</font><font  class="lineb ">{{index $v "OpScope"}}</font></div>{{end}}
 								</div>
 							</div>
 						</div>

+ 0 - 1
core/src/web/templates/service/demand.html

@@ -23,7 +23,6 @@
 </style>
 <head>
 <body>
-	{{include "/common/login.html"}}
 	{{include "/common/indexhead.html"}}
 	<div class="container-fluid a-content">
 		<div class="g-demand-main">

+ 0 - 1
core/src/web/templates/service/detail.html

@@ -47,7 +47,6 @@
 <body>
 	<img src="{{.T.sinfo.s_shareimg}}" style="width:0px;height:0px;"/>
 	<!-- 审核头部 -->
-	{{include "/common/login.html"}}
 	{{include "/common/indexhead.html"}}
 	<div class="container-fluid a-content">
 		<div class="a-c-left a-servicedetail" >

+ 0 - 1
core/src/web/templates/service/list.html

@@ -58,7 +58,6 @@
 <link href="/css/index-new.css" rel="stylesheet">
 </head>
 <body >
-{{include "/common/login.html"}}
 {{include "/common/indexhead.html"}}
 
 								

+ 0 - 1
core/src/web/templates/service/viewsingledemand.html

@@ -22,7 +22,6 @@
   <body>
 <img src="{{.T.demandInfo.s_shareimg}}" style="width:0px;height:0px;"/>
 
-    {{include "/common/login.html"}}
 	{{include "/common/indexhead.html"}}
     <div class="container-fluid a-content">