Эх сурвалжийг харах

Merge branch 'develop' of 192.168.3.17:zhanghongbo/qfw into develop

wangchuanjin 9 жил өмнө
parent
commit
cadbc70bcf

+ 28 - 0
common/src/qfw/util/mongodbutil/mongodbutil.go

@@ -300,6 +300,34 @@ func SaveBulk(c, alias, db string, doc ...map[string]interface{}) bool {
 	return b
 }
 
+//统计
+func Count(c, alias, db string, query interface{}) int {
+	sess := GetMgoConn(alias)
+	var n int = 0
+	if sess != nil {
+		defer func() {
+			if r := recover(); r != nil {
+				log.Println("[E]", r)
+				for skip := 1; ; skip++ {
+					_, file, line, ok := runtime.Caller(skip)
+					if !ok {
+						break
+					}
+					go log.Printf("%v,%v\n", file, line)
+				}
+			}
+		}()
+		defer DestoryMongoConn(alias, sess)
+		coll := sess.DB(db).C(c)
+		var err error
+		n, err = coll.Find(ObjToM(query)).Count()
+		if nil != err {
+			log.Println("CountError", err)
+		}
+	}
+	return n
+}
+
 //对象转数组
 func ObjToArr(obj interface{}) []string {
 	if s, ok := obj.(string); ok {

+ 1 - 1
core/src/timetask.json

@@ -1 +1 @@
-{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-03-25 11:59:32"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-03-25 11:59:32"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-03-25 14:50:42"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-03-25 14:50:42"}},"marketisstart":true,"marketrate":300}

+ 7 - 2
core/src/web/staticres/wxswordfish/style.css

@@ -622,7 +622,7 @@ img{
 .toolbar-popover{
 	position: absolute;
 	width: 90px;
-	height: 100px;
+	height: 120px;
 	border: 1px solid #CCCCCC;
 	background-color: #F8F8F8;
 	bottom: 65px;
@@ -632,7 +632,7 @@ img{
 	display: none;
 }
 .popover-ul li{
-	line-height: 30px;
+	line-height: 38px;
 }
 .toolbar-popover .popover-arrow{
 	bottom: -11px;
@@ -658,4 +658,9 @@ img{
 }
 .popover-ul li.active{
 	background-color: #EAEAEA;
+}
+.popover-ul >li:nth-child(2){
+	width: 85%;
+	border-top:1px solid #e5e6e9;
+	border-bottom:1px solid #e5e6e9;
 }

+ 53 - 9
core/src/web/templates/swordfish/wxsearchlist.html

@@ -146,15 +146,17 @@ body{
 	background-color:#FFFFFF; 
 	border:1px solid #e5e6e9;
 	height:45px;
-	width:100%;
+	width:78%;
     border-radius: 10px;
 	padding:2px 10px 2px 60px;
 	font-size:16px;
-	position:relative;
+	position:absolute;
 }
 .wxhead{
     padding: 10px 15px;
 	background-color:#F0F0F0;
+	position: relative;
+    height: 65px;
 }
 .tubiao img{
     position: absolute;
@@ -171,7 +173,7 @@ body{
     position: absolute;
     z-index: 10;
     top: 20px;
-	right: 30px;
+	right: 22%;
 	height:25px;
 }
 .rsssetbtn{
@@ -259,6 +261,9 @@ body{
 	background-color:#fff;
 	width:100%;
 }
+.nullcontent{
+	height: 100%;
+}
 .tslist{
 	height:80px;
 	border-bottom: 1px solid #ccc;
@@ -270,17 +275,46 @@ body{
 .parent-node img {
 	vertical-align: sub !important;
 }
+.input-group-addon {
+	float:right;
+    border: 0px;
+    border-radius: 0px;
+    width: 60px;
+    color: #FFF;
+    background-color: rgb(22,160,134);
+}
+.chax{
+	margin: 2px 0px;
+	float:right;
+	width:13%;
+	height:41px;
+	border:1px solid #35C5DA;
+	background-color:#35C5DA;
+	border-radius: 5px;
+	color:#fff;
+    padding-top: 8px;
+    font-size: 20px;
+}
 </style>
 </head>
 <body>
 <div style="background-color:#fff;">
-<div class="wxhead"><span class="tubiao"><img src="{{Msg "seo" "cdn"}}/images/wxjss.png"/></span><input class="form-control searchname" name="searchname" value="{{.T.keywords}}" placeholder="输入关键词查询"/>
-<span class="xiaochu"><img class="qcimg" src="{{Msg "seo" "cdn"}}/images/wxqc.png"/></span>
+<div class="wxhead">
+<span class="tubiao">
+<img src="{{Msg "seo" "cdn"}}/images/wxjss.png"/>
+</span>
+<input class="form-control searchname" name="searchnameone" value="{{.T.keywords}}" placeholder="输入关键词查询"/>
+<span class="xiaochu">
+<img class="qcimg" src="{{Msg "seo" "cdn"}}/images/wxqc.png"/>
+</span>
+<span class="chax text-center">
+<i class="glyphicon sousuo"></i>
+</span>
 </div>
 <div class="rescontent">
 	
 </div>
-<div style="height:40px;"></div>
+<div style="height:80px;"></div>
 
 </div>
 <div class="resbm" >
@@ -298,11 +332,21 @@ body{
 </div>
 <div>没有找到和该关键词匹配的信息</div>
 </div>
-
+<div style="display:none;">
+<form action="/member/wxswordfish/searchlist" name="searchone" method="post">
+	<input name="searchname" id="searchname" value="" style="display:none;"/>
+	<input name="s_type" id="sea_type" value="{{.T.s_type}}" style="display:none;"/>
+	<input name="s_name" id="sea_name" value="" style="display:none;"/>
+</form>
+</div>
 {{include "/swordfish/wxtoolbar.html"}}
 <script type="text/javascript">
-	$(".searchname").click(function(){
-        window.location.href="/member/wxswordfish/search";
+	$(".chax").click(function(){
+		var searchname = $(".searchname").val();
+		document.getElementById("searchname").value = searchname;
+		searchname = searchname.replace(/^\s+|\s+$/g,"").replace(/\s+/g,"+");
+		document.getElementById("sea_name").value = searchname;
+		document.forms['searchone'].submit();
     });
 	$(".qcimg").click(function(){
 		$(".searchname").val("");