Browse Source

Merge branch 'dev2.9.0' of http://39.105.157.10:10080/qmx/jy into dev2.9.0

wangshan 5 năm trước cách đây
mục cha
commit
15a8cc798c

+ 9 - 12
src/jfw/modules/app/src/web/templates/dataExport/dataExport_toMyOrder.html

@@ -1004,20 +1004,15 @@
 					}
 					$(".loading_").show();
 					interval_ent=setInterval(function(){
-						$.post("/entniche/ispaysuccess",{code:order_entcode},function(r){
+						$.post("/entniche/ispaysuccess",{ordercode:order_entcode},function(r){
 							if(r.data.status==1){
 								$(".loading_").show();
 								setTimeout(function(){
 									$(".loading_").hide();
 										setSessionStorage();
-									try{
-										JyObj.checkLab()//刷新搜索首页和订阅首页
-										sessionStorage.reloadHomePage = true;
-										sessionStorage.reloadSubPage = true;
-									}catch(e){}	
 									window.location.href="/page_entniche/page/buy_production/pay_success.html?ordercode="+order_entcode;
 									clearInterval(interval_ent);
-								})
+								},800)
 							}
 						})
 					},3000)
@@ -2111,9 +2106,8 @@
 					var id_ent =obj.id;
 					//支付方式
 					var pay_way_ent=obj.pay_way;
-					//企业状态
-					var i_ent_status=obj.i_ent_status;
-					console.log(i_ent_status)
+					//是否显示续费按钮
+					var ent_status=obj[order_code_ent];
 					var order_status_ent_str="";
 					if(order_status_ent==0){
 						order_status_ent_str="待付款"
@@ -2131,14 +2125,17 @@
 						orderHtml+='<span class="status">'+order_status_ent_str+'</span>'
 						orderHtml+="<a class=\"shanchu iconfont  icon-shanchu\" title=\"删除订单\" onclick=\"deleteOrder(" + id_ent +",this)\"></a>";
 						iconHtml=""
-						if((i_ent_status==false)&&(obj.lastbuy_code_ent!=undefined)){
+						if(ent_status==false){
 							iconHtml+='<div class="card-footer">'
 									+'<a  onclick="renewalOrBuyAgain_ent(1,this)" class="btn cancle">再次购买</a>'
 								+'</div>'
-						}else if((i_ent_status==true)&&(obj.lastbuy_code_ent!=undefined)){
+						}else if(ent_status==true){
 							iconHtml+='<div class="card-footer">'
 									+'<a  onclick="renewalOrBuyAgain_ent(2,this)" class="btn cancle">续费</a>'
 								+'</div>'
+						}else{
+							iconHtml+='<div class="card-footer">'
+								+'</div>'
 						}
 					}else if(order_status_ent==-2){
 						order_status_ent_str="已取消";

+ 4 - 8
src/jfw/modules/app/src/web/templates/entniche/entniche_order_detail.html

@@ -601,7 +601,7 @@ body .loading_ p span {
 										$(".loading_").hide();
 						                $('.pay_way').hide(200)
 										canpay=true;
-						                checkPaySuccess_ent(data.order);
+						                checkPaySuccess_ent(orderCode);
 						    	}else{
 									canpay=false;
 								}
@@ -655,22 +655,18 @@ body .loading_ p span {
 		    });
 		}
 		
+		var interval_ent
 		function checkPaySuccess_ent(order_code){
 			if(interval_ent){
 				clearInterval(interval_ent)
 			}
 			$(".loading_").show();
 			interval_ent=setInterval(function(){
-				$.post("/entniche/ispaysuccess",{code:order_code},function(r){
+				$.post("/entniche/ispaysuccess",{ordercode:order_code},function(r){
 					if(r.data.status==1){
 						clearInterval(interval_ent);
 						$(".loading_").hide();
-						try{
-							JyObj.checkLab()//刷新搜索首页和订阅首页
-							sessionStorage.reloadHomePage = true;
-							sessionStorage.reloadSubPage = true;
-						}catch(e){}	
-						window.location.href="/page_entniche/page/buy_production/pay_success.html?ordercode="+order_entcode;
+						window.location.href="/page_entniche/page/buy_production/pay_success.html?ordercode="+order_code;
 					}
 				})
 			},3000)

+ 5 - 0
src/jfw/modules/app/src/web/templates/entniche/entniche_seniorset.html

@@ -29,6 +29,11 @@
 			font-size: 14px;
 			color: #686868;
 		}
+		.seniorsetpage .navchoose li:last-child.on {
+		    padding: 28px 0px 27px 0px;
+		    line-height: 0px;
+		    height: inherit;
+		}
 	</style>
     <script>
 		var keepOneTipWayMsg = "请保留一种推送方式,<br>剑鱼标讯还要推送信息给您";

+ 16 - 15
src/jfw/modules/entniche/src/entity/department.go

@@ -62,14 +62,13 @@ func (d *Department) GetUsers(ent_id, dept_id int) *[]*User {
 
 //获取部门下所有的员工,包含子部门
 func (d *Department) GetAllUsers(ent_id, dept_id int) *[]*User {
-	r := Mysql.SelectBySql(`select d.id,d.name,d.phone,f.name as role from entniche_department a 
-   		LEFT JOIN entniche_department_parent b on (a.id=b.id) 
-		INNER JOIN entniche_department_user c on (a.id=c.dept_id) 
-		INNER JOIN entniche_user d on (c.user_id=d.id) 
-		LEFT JOIN entniche_user_role e on (d.id=e.user_id) 
-		LEFT JOIN entniche_role f on (e.role_id=f.id) 
-		where (f.id <> 1 or f.id is NULL) and a.ent_id=? and (a.id=? or b.pid=?) 
-		order by convert(d.name using gbk) COLLATE gbk_chinese_ci asc`, ent_id, dept_id, dept_id)
+	r := Mysql.SelectBySql(`select DISTINCT c.id,c.name,c.phone,e.name as role from entniche_department_parent a
+		INNER JOIN entniche_department_user b on (a.id=b.dept_id) 
+		INNER JOIN entniche_user c on (b.user_id=c.id) 
+		LEFT JOIN entniche_user_role d on (c.id=d.user_id) 
+		LEFT JOIN entniche_role e on (d.role_id=e.id) 
+		where (e.id <> 1 or e.id is NULL) and c.ent_id=? and (a.id=? or a.pid=?) 
+		order by convert(c.name using gbk) COLLATE gbk_chinese_ci asc`, ent_id, dept_id, dept_id)
 	users, _ := JsonUnmarshal(r, &[]*User{}).(*[]*User)
 	if users == nil {
 		return &[]*User{}
@@ -80,14 +79,16 @@ func (d *Department) GetAllUsers(ent_id, dept_id int) *[]*User {
 //获取部门下所有子部门和部门下员工
 func (d *Department) GetDeptAndUser(ent_id, dept_id int) *[]*Department {
 	r := Mysql.SelectBySql(`select a.id,a.name,b.user_count,c.dept_count from entniche_department a 
-		LEFT JOIN (select b.id,count(c.user_id) as user_count from entniche_department b 
-			INNER JOIN entniche_department_user c on (b.id=c.dept_id) 
-			where b.ent_id=? and b.pid=? GROUP BY b.id
+		LEFT JOIN (SELECT a.id,count(DISTINCT a.id,c.user_id) as user_count from entniche_department_parent a
+			LEFT JOIN entniche_department_parent b on (a.id=b.pid)
+			INNER JOIN entniche_department_user c on (b.id=c.dept_id or a.id=c.dept_id)
+			where a.pid=? GROUP BY a.id
 		) b on (a.id=b.id) 
-		LEFT JOIN (select b.id,count(c.id) as dept_count from entniche_department b 
-			INNER JOIN entniche_department c on (b.id=c.pid) 
-			where b.ent_id=? and b.pid=? GROUP BY b.id
-		) c on (a.id=c.id) where a.ent_id=? and a.pid=?`, ent_id, dept_id, ent_id, dept_id, ent_id, dept_id)
+		LEFT JOIN (select a.id,count(b.id) as dept_count from entniche_department a 
+			INNER JOIN entniche_department b on (a.id=b.pid) 
+			where a.pid=? GROUP BY a.id
+		) c on (a.id=c.id) 
+		where a.ent_id=? and a.pid=? ORDER BY a.id`, dept_id, dept_id, ent_id, dept_id)
 	departments, _ := JsonUnmarshal(r, &[]*Department{}).(*[]*Department)
 	if departments == nil {
 		return &[]*Department{}

+ 4 - 8
src/jfw/modules/entniche/src/service/department/department.go

@@ -51,18 +51,14 @@ func (a *Action) Add() {
 				"createtime": nowFormat,
 				"timestamp":  nowFormat,
 			})
-			var user_role_id int64
-			aid, _ := a.GetInteger("aid")
-			if aid > 0 {
-				user_role_id = Mysql.InsertByTx(tx, Entniche_user_role, map[string]interface{}{
-					"user_id": aid,
-					"role_id": Role_admin_department,
-				})
+			setAdminFlag := true
+			if aid, _ := a.GetInteger("aid"); aid > 0 {
+				setAdminFlag = VarDepartment.SetAdmin(tx, entId, int(dept_id), aid)
 			}
 			dept_parent_id_1 := Mysql.InsertBySqlByTx(tx, `INSERT INTO entniche_department_parent (id,pid)
 				SELECT ? as id,pid from entniche_department_parent where id=?`, dept_id, pid)
 			dept_parent_id_2 := Mysql.InsertBySqlByTx(tx, `INSERT INTO entniche_department_parent (id,pid) values(?,?)`, dept_id, pid)
-			return dept_id > 0 && user_role_id > -1 && dept_parent_id_1 > -1 && dept_parent_id_2 > -1
+			return dept_id > 0 && setAdminFlag && dept_parent_id_1 > -1 && dept_parent_id_2 > -1
 		}) {
 			status = 1
 		} else {

+ 9 - 5
src/jfw/modules/entniche/src/service/distribute/distribute.go

@@ -118,7 +118,8 @@ func (ac *Action) Distribute_persons() {
 	if len(persons) > 0 {
 		person_arr := []interface{}{}
 		for _, v := range persons {
-			person_arr = append(person_arr, strconv.Itoa(int(v["id"].(int64))))
+			//			person_arr = append(person_arr, strconv.Itoa(int(v["id"].(int64))))
+			person_arr = append(person_arr, strconv.Itoa(v["id"].(int)))
 		}
 		sql := "SELECT user_id AS id,COUNT(1) AS COUNT FROM entniche_user_rule WHERE user_id IN ("
 		for i := 0; i < len(person_arr); i++ {
@@ -164,7 +165,6 @@ func (ac *Action) Distribute_add() {
 		ac.ServeJson(Result{Data: M{"status": status}})
 		return
 	}
-	log.Println(distribute_ruleMap)
 	createtime := time.Now().Unix()
 	if len(distribute_ruleMap) > 0 {
 		if distribute_ruleMap["area"] != nil {
@@ -190,7 +190,8 @@ func (ac *Action) Distribute_add() {
 		ac.ServeJson(Result{Data: M{"status": status}})
 		return
 	}
-	if distribute_ruleMap["persons"] != nil {
+	persons := distribute_ruleMap["persons"].([]interface{})
+	if len(persons) > 0 {
 		//转化
 		person := []interface{}{}
 		if len(distribute_ruleMap["persons"].([]interface{})) > 0 {
@@ -226,12 +227,16 @@ func (ac *Action) Distribute_delete() {
 	}
 	id := ac.GetString("id")
 	log.Println(id)
+	deletelb := true
 	//分发规则状态    0--未删除  1--删除
 	bl := util.MQFW.UpdateById(util.Entniche_distribute, id, bson.M{"$set": bson.M{"i_status": 1}})
-	deletelb := util.Mysql.Delete(util.Entniche_user_rule, M{"rule_id": id})
+	if util.Mysql.FindOne(util.Entniche_user_rule, M{"rule_id": id}, "user_id", "") != nil {
+		deletelb = util.Mysql.Delete(util.Entniche_user_rule, M{"rule_id": id})
+	}
 	if bl && deletelb {
 		status = 1
 	}
+	log.Println("删除分发规则接口:", status)
 	ac.ServeJson(Result{Data: M{"status": status}})
 	return
 }
@@ -331,7 +336,6 @@ func (ac *Action) Distribute_update() {
 				"o_area":       distribute_rule["o_area"],
 				"a_buyerclass": distribute_rule["a_buyerclass"],
 			}})
-			log.Println(addbl, "---", ok)
 			if ok && addbl {
 				status = 1
 			}

+ 27 - 25
src/jfw/modules/entniche/src/service/subscribe/subscribe.go

@@ -45,6 +45,7 @@ func (ac *Action) Subscribe_index() error {
 	}
 	var o_entniche *map[string]interface{}
 	model := entInfo.Ent.Model //1-统一订阅 2-个人订阅
+	log.Println("model:", model)
 	if model == 1 {
 		o_entniche, _ = util.MQFW.FindOne("entniche_rule", map[string]interface{}{
 			"i_deptid": entInfo.Dept.Id,
@@ -260,7 +261,7 @@ func (ac *Action) Get_infotype() {
 	delete(*res, "_id")
 	//转换
 	o_entniche := qutil.ObjToMap((*res)["o_entniche"])
-	if len(*o_entniche) != 0 {
+	if (*o_entniche)["a_infotype"] != nil {
 		data = qutil.ObjArrToStringArr((*o_entniche)["a_infotype"].([]interface{}))
 	} else {
 		data = nil
@@ -360,15 +361,15 @@ func (ac *Action) Get_key() {
 			status = 1
 		}
 	}
-	log.Println(o_entniche)
-	if len(*o_entniche) != 0 {
+	log.Println("----", o_entniche)
+	if (*o_entniche)["a_items"] != nil {
 		//data = qutil.ObjArrToStringArr((*o_entniche)["a_items"].([]interface{}))
 		data = qutil.ObjArrToMapArr((*o_entniche)["a_items"].([]interface{}))
 	} else {
 		data = nil
 	}
 
-	log.Println("查看key:", data)
+	log.Println("status", status, "查看key:", data)
 	ac.ServeJson(Result{Data: M{"data": data, "status": status}})
 	return
 }
@@ -517,29 +518,30 @@ func (ac *Action) Get_fastimport() {
 		ac.ServeJson(Result{Data: M{"status": 0}})
 		return
 	}
+	if o_entniche["a_items"] != nil {
+		a_items_ent = qutil.ObjArrToMapArr(o_entniche["a_items"].([]interface{}))
+		for k, v := range a_items_ent {
+			s_item := qutil.ObjToString(v["s_item"])
+			a[s_item] = k + 1
+			a_key := qutil.ObjArrToMapArr(v["a_key"].([]interface{}))
+			for _, n := range a_key {
+				notkey := []string{}
+				appendkey := []string{}
+				if n["notkey"] != nil {
+					notkey = qutil.ObjArrToStringArr(n["notkey"].([]interface{}))
+				}
+				key := qutil.ObjArrToStringArr(n["key"].([]interface{}))
+				if n["appendkey"] != nil {
+					appendkey = qutil.ObjArrToStringArr(n["appendkey"].([]interface{}))
+				}
 
-	a_items_ent = qutil.ObjArrToMapArr(o_entniche["a_items"].([]interface{}))
-	for k, v := range a_items_ent {
-		s_item := qutil.ObjToString(v["s_item"])
-		a[s_item] = k + 1
-		a_key := qutil.ObjArrToMapArr(v["a_key"].([]interface{}))
-		for _, n := range a_key {
-			notkey := []string{}
-			appendkey := []string{}
-			if n["notkey"] != nil {
-				notkey = qutil.ObjArrToStringArr(n["notkey"].([]interface{}))
-			}
-			key := qutil.ObjArrToStringArr(n["key"].([]interface{}))
-			if n["appendkey"] != nil {
-				appendkey = qutil.ObjArrToStringArr(n["appendkey"].([]interface{}))
-			}
-
-			key_str := strings.Join(key, "")
-			notkey_str := strings.Join(notkey, "")
-			appendkey_str := strings.Join(appendkey, "")
-			keys := key_str + notkey_str + appendkey_str
+				key_str := strings.Join(key, "")
+				notkey_str := strings.Join(notkey, "")
+				appendkey_str := strings.Join(appendkey, "")
+				keys := key_str + notkey_str + appendkey_str
 
-			b[keys] = true
+				b[keys] = true
+			}
 		}
 	}
 	//vip设置关键词

+ 82 - 40
src/jfw/modules/subscribepay/src/service/orderListDetails.go

@@ -197,10 +197,8 @@ func (o *OrderListDetails) DeleteOrder() error {
 		typ := o.GetString("type")
 		cancel := o.GetString("cancel")
 		pageNum, _ := o.GetInteger("pageNum")
-		log.Println("typ", typ)
 		if typ != "0" && typ != "" {
 			var status string
-			log.Println("typ", typ)
 			if typ == "1" {
 				status = orderStatus_unPaid
 			} else if typ == "2" {
@@ -509,6 +507,8 @@ func (o *OrderListDetails) GetEntnicheDetails() {
 }
 
 func (o *OrderListDetails) SetRes(res []map[string]interface{}, queryM map[string]interface{}) {
+	entid := o.GetUserEntId() //用户购买的entid
+	ent_ordercode := GetEntOrdercode(queryM, entid)
 	var create_time_stamp int64 = 0
 	//获取最后一次购买的vip订单
 	queryM["product_type"] = "VIP订阅"
@@ -518,13 +518,7 @@ func (o *OrderListDetails) SetRes(res []map[string]interface{}, queryM map[strin
 		lastbuy_code = qutil.ObjToString(lastbuy[0]["order_code"])
 	}
 	delete(queryM, "product_type")
-	queryM["product_type"] = "企业商机管理"
-	lastbuy_ent := *util.Mysql.Find(tableName_order, queryM, "order_code,pay_time", "pay_time desc", -1, 0)
-	lastbuy_code_ent := ""
-	if len(lastbuy_ent) > 0 && lastbuy_ent != nil {
-		lastbuy_code_ent = qutil.ObjToString(lastbuy_ent[0]["order_code"])
-	}
-	delete(queryM, "product_type")
+
 	for _, v := range res {
 		//获取单号 如果是vip xx小时取消
 		order_code := qutil.ObjToString(v["order_code"])
@@ -579,11 +573,6 @@ func (o *OrderListDetails) SetRes(res []map[string]interface{}, queryM map[strin
 		if lastbuy_code == v["order_code"] {
 			v["lastbuy_code"] = lastbuy_code
 		}
-		//最后一次购买的ent订单
-		if lastbuy_code_ent == v["order_code"] {
-			v["lastbuy_code_ent"] = lastbuy_code_ent
-		}
-		//
 		if v["pay_time"] != nil && ((v["product_type"] == "VIP订阅") || (v["product_type"] == "VIP订阅")) {
 			data, err := util.MQFW.FindOne("user", bson.M{"_id": bson.ObjectIdHex(qutil.ObjToString(o.GetSession("userId")))})
 			if len(*data) > 0 && err {
@@ -592,7 +581,16 @@ func (o *OrderListDetails) SetRes(res []map[string]interface{}, queryM map[strin
 		}
 		//
 		if v["pay_time"] != nil && v["product_type"] == "企业商机管理" {
-			v["i_ent_status"] = isEntExpire(qutil.ObjToString(o.GetSession("userId")))
+			if IsContain(ent_ordercode, qutil.ObjToString(v["order_code"])) {
+				renew, repurchase := isEntExpire(qutil.ObjToString(o.GetSession("userId")), qutil.ObjToString(v["order_code"]))
+				if renew {
+					v[qutil.ObjToString(v["order_code"])] = true
+				}
+				//
+				if repurchase {
+					v[qutil.ObjToString(v["order_code"])] = false
+				}
+			}
 		}
 	}
 }
@@ -656,7 +654,6 @@ func isEmail(value string) bool {
 
 //获取支付单号
 func getPayTransactionId(payWay, tradeNo string) (transaction_id string) {
-	log.Println(payWay, tradeNo)
 	if payWay == "" || tradeNo == "" {
 		return
 	}
@@ -709,36 +706,81 @@ func FortyEightHoursCancel(order string, create_time_stamp, now_time_stamp int64
 	}
 }
 
-//判断用户购买的企业商机管理是否到期
-func isEntExpire(userid string) bool {
+//判断用户购买的企业商机管理是否显示续费按钮	--返回值第一个参数 是判断是否显示续费按钮 第二个参数 是判断是否显示再次购买按钮
+func isEntExpire(userid, order_code string) (bool, bool) {
 	u, ok := util.MQFW.FindById("user", userid, `{"s_phone":1}`)
 	if ok && u != nil && (*u)["s_phone"] != nil {
-		//		list := util.Mysql.SelectBySql(`SELECT DISTINCT a.id,a.name,a.phone,a.startdate,a.enddate from entniche_info a
-		//				INNER JOIN entniche_user b on (a.id=b.ent_id)
-		//				where a.phone=? or b.phone=?
-		//				order by convert(a.name using gbk) COLLATE gbk_chinese_ci asc`, (*u)["s_phone"].(string), (*u)["s_phone"].(string))
-		list := util.Mysql.SelectBySql(`select filter from dataexport_order where user_id=? and product_type=? and order_status=?`, userid, "企业商机管理", 1)
-		if len(*list) > 0 {
-			for _, v := range *list {
-				filterStr := qutil.ObjToString(v["filter"])
-				var filter map[string]interface{}
-				if err := json.Unmarshal([]byte(filterStr), &filter); err != nil {
-					log.Printf("%s 判断用户购买的企业商机管理是否到期 isEntExpire Unmarshal 出错 [%s]\n", userid, filterStr)
-					return false
+		//list := util.Mysql.SelectBySql(`select filter from dataexport_order where user_id=? and product_type=? and order_status=?`, userid, "企业商机管理", 1)
+		list := util.Mysql.FindOne("dataexport_order", bson.M{"order_code": order_code}, "filter", "")
+		if list != nil {
+			//for _, v := range *list {
+			filterStr := qutil.ObjToString((*list)["filter"])
+			var filter map[string]interface{}
+			if err := json.Unmarshal([]byte(filterStr), &filter); err != nil {
+				log.Printf("%s 判断用户购买的企业商机管理是否到期 isEntExpire Unmarshal 出错 [%s]\n", userid, filterStr)
+				return false, false
+			}
+			date := util.Mysql.FindOne("entniche_info", bson.M{"name": qutil.ObjToString(filter["entname"])}, "startdate,enddate", "")
+			if date != nil {
+				startdate := qutil.Int64All((*date)["startdate"])
+				enddate := qutil.Int64All((*date)["enddate"])
+				start_year := time.Unix(qutil.Int64All((*date)["startdate"]), 0).Format("2006")
+				end_year := time.Unix(qutil.Int64All((*date)["enddate"]), 0).Format("2006")
+				effective_cycle := qutil.IntAll(end_year) - qutil.IntAll(start_year) //生效周期
+				now := time.Now().Unix()
+				if now >= startdate && now < enddate && effective_cycle < 3 {
+					return true, false
 				}
-				date := util.Mysql.FindOne("entniche_info", bson.M{"name": qutil.ObjToString(filter["entname"])}, "startdate,enddate", "")
-				log.Println(date)
-				if date != nil {
-					startdate := qutil.Int64All((*date)["startdate"])
-					enddate := qutil.Int64All((*date)["enddate"])
-					log.Println(startdate)
-					now := time.Now().Unix()
-					if now >= startdate && now < enddate {
-						return true
-					}
+				if now > enddate {
+					return false, true
+				}
+			}
+			//}
+		}
+	}
+	return false, false
+}
+
+func (o *OrderListDetails) GetUserEntId() []int {
+	userid := o.GetSession("userId").(string)
+	ids := []int{}
+	if userid != "" {
+		phone, ok := util.MQFW.FindById("user", userid, "s_phone")
+		if ok && (*phone)["s_phone"] != nil {
+			id := util.Mysql.Find("entniche_info", bson.M{"phone": qutil.ObjToString((*phone)["s_phone"])}, "id", "", -1, -1)
+			if id != nil {
+				for _, v := range *id {
+					ids = append(ids, qutil.IntAll(v["id"]))
 				}
 			}
 		}
 	}
+	return ids
+}
+
+func GetEntOrdercode(query map[string]interface{}, entid []int) []string {
+	//获取购买的所有企业最近一次的ordercode
+	entordercode := []string{}
+	query["product_type"] = "企业商机管理"
+	for _, v := range entid {
+		query["filter_id"] = v
+		lastbuy_ent := *util.Mysql.Find(tableName_order, query, "order_code,pay_time", "pay_time desc", -1, 0)
+		if len(lastbuy_ent) > 0 && lastbuy_ent != nil {
+			entordercode = append(entordercode, qutil.ObjToString(lastbuy_ent[0]["order_code"]))
+		}
+		delete(query, "filter")
+
+	}
+	delete(query, "product_type")
+	return entordercode
+}
+
+//判断数组是否包含
+func IsContain(slice []string, s string) bool {
+	for _, qq := range slice {
+		if qq == s {
+			return true
+		}
+	}
 	return false
 }