Jianghan пре 8 месеци
родитељ
комит
e29e681820

+ 12 - 1
SEPlatform/client/client.go

@@ -12,6 +12,7 @@ import (
 	"regexp"
 	. "seplatform/util"
 	"strconv"
+	"strings"
 	"time"
 )
 
@@ -67,6 +68,8 @@ func (this *Client) PersonnelIndex() {
 		start, _ := this.GetInt("start")
 		limit, _ := this.GetInt("length")
 		draw, _ := this.GetInt("draw")
+		searchStr := this.GetString("search[value]")
+		search := strings.TrimSpace(searchStr)
 		entUserId := 0
 		user := this.GetSession("user").(map[string]interface{})
 		if id == "" {
@@ -77,7 +80,15 @@ func (this *Client) PersonnelIndex() {
 		entId := qu.IntAll(user["ent_id"])
 		count := Mgo.Count("entniche_rule", map[string]interface{}{"entId": entId, "entUserId": entUserId})
 
-		entRuleArr, ok := Mgo.Find("entniche_rule", map[string]interface{}{"entId": entId, "entUserId": entUserId}, `{"_id":-1}`, nil, false, int(start), int(limit))
+		query := map[string]interface{}{
+			"entId": entId, "entUserId": entUserId,
+		}
+		if search != "" {
+			query["s_name"] = bson.M{
+				"$regex": search,
+			}
+		}
+		entRuleArr, ok := Mgo.Find("entniche_rule", query, `{"_id":-1}`, nil, false, int(start), int(limit))
 		if ok && entRuleArr != nil && *entRuleArr != nil && len(*entRuleArr) > 0 {
 			for _, v := range *entRuleArr {
 				ruleid := mongodb.BsonIdToSId(v["_id"])

+ 9 - 9
SEPlatform/filter/sessfilter.go

@@ -27,15 +27,15 @@ func (s *sessfilter) Do(w http.ResponseWriter, req *http.Request) bool {
 		has := (loginuser != nil && loginuser != "")
 		if has {
 			b = true
-			user := loginuser.(map[string]interface{})
-			if user["role"] == "3" {
-				if !CustomerReg.MatchString(req.URL.Path) {
-					b = false
-				}
-			}
-			if user["role"] == "" || user["role"] == nil {
-				b = false
-			}
+			//user := loginuser.(map[string]interface{})
+			//if user["role"] == "3" {
+			//	if !CustomerReg.MatchString(req.URL.Path) {
+			//		b = false
+			//	}
+			//}
+			//if user["role"] == "" || user["role"] == nil {
+			//	b = false
+			//}
 		} else {
 			b = false
 		}

+ 1 - 0
SEPlatform/main.go

@@ -6,6 +6,7 @@ import (
 	"app.yhyue.com/moapp/jybase/redis"
 	"log"
 	"seplatform/client"
+	_ "seplatform/filter"
 	"seplatform/front"
 	"seplatform/recharge"
 	"seplatform/service"

+ 7 - 0
SEPlatform/service/private_service.go

@@ -77,6 +77,12 @@ func (f *Private) Keydatademo(world string) {
 					delete(v, "_id")
 					delete(v, "s_dataid")
 					delete(v, "i_createtime")
+					uinfo, b := MgoSave.FindOneByField(SaveUserMail, bson.M{"id": v["id"], "appid": v["appid"]}, bson.M{"id": 1})
+					if b && len(*uinfo) > 0 {
+						v["usermail_exist"] = true
+					} else {
+						v["usermail_exist"] = false
+					}
 					if v["bidamount"] != nil {
 						v["bidamount"] = qu.Float64All(fmt.Sprintf("%f", qu.Float64All(v["bidamount"])))
 					}
@@ -209,6 +215,7 @@ func (f *Private) Keydataoption(world string) {
 						delete(v, "_id")
 						newIdArr = append(newIdArr, infoid)
 					}
+					v["datasource"] = "自助导出"
 					infoArr = append(infoArr, v)
 				}
 			}