zhangxinlei1996 5 years ago
parent
commit
61d7add3f0

+ 11 - 3
src/jfw/modules/app/src/web/templates/dataExport/dataExport_toMyOrder.html

@@ -730,7 +730,7 @@
 																	 if(courseOrder !== "true"){
 																		if (isEntOrder=="true"){
 																			self.text("已取消");
-																			$(obj).parent(".card-footer").html(`<div></div>`)
+																			$(obj).parent(".card-footer").html('<a  onclick="renewalOrBuyAgain_ent(1,this)" class="btn cancle">再次购买</a>')
 																		}else{
 																			self.text("已取消");
 																			$(obj).parent(".card-footer").html('<a  onclick="onceMore(this)" class="btn cancle">再次购买</a>')
@@ -821,11 +821,15 @@
 				$('input:radio[name="way"]').click(function() {
 					var checkValue = $('input:radio[name="way"]:checked').val();
 					var order_code_vip=$(".order_code_vip").text();
+					var order_code_ent=$(".order_code_ent").text();
 		        	if(checkValue=="微信支付"){
 		        		localStorage.setItem($(".param_id").text(),"wx");
 						if(order_code_vip){
 		        			localStorage.setItem(order_code_vip,"wx");
 						}
+						if(order_code_ent){
+		        			localStorage.setItem(order_code_ent,"wx");
+						}
 		        		$("#wx").prop("checked",true);
 						$("#zfb").prop("checked",false);
 		            	pay_way="wx_app";
@@ -834,6 +838,9 @@
 		        		if(order_code_vip){
 		        			localStorage.setItem(order_code_vip,"ali");
 						}
+						if(order_code_ent){
+		        			localStorage.setItem(order_code_ent,"wx");
+						}
 		        		$("#wx").prop("checked",false);
 						$("#zfb").prop("checked",true);
 		        		pay_way="ali_app";
@@ -2126,11 +2133,11 @@
 						iconHtml=""
 						if((i_ent_status==false)&&(obj.lastbuy_code_ent!=undefined)){
 							iconHtml+='<div class="card-footer">'
-									+'<a  onclick="renewalOrBuyAgain_ent(2,this)" class="btn cancle">再次购买</a>'
+									+'<a  onclick="renewalOrBuyAgain_ent(1,this)" class="btn cancle">再次购买</a>'
 								+'</div>'
 						}else if((i_ent_status==true)&&(obj.lastbuy_code_ent!=undefined)){
 							iconHtml+='<div class="card-footer">'
-									+'<a  onclick="renewalOrBuyAgain_ent(1,this)" class="btn cancle">续费</a>'
+									+'<a  onclick="renewalOrBuyAgain_ent(2,this)" class="btn cancle">续费</a>'
 								+'</div>'
 						}
 					}else if(order_status_ent==-2){
@@ -2140,6 +2147,7 @@
 						orderHtml+="<a class=\"shanchu iconfont  icon-shanchu\" title=\"删除订单\" onclick=\"deleteOrder(" + id_ent +",this)\"></a>";
 						iconHtml="";
 						iconHtml+='<div class="card-footer">'
+								+'<a  onclick="renewalOrBuyAgain_ent(1,this)" class="btn cancle">再次购买</a>'
 								+'</div>'
 					}
 					//

+ 2 - 2
src/jfw/modules/subscribepay/src/service/entniche.go

@@ -241,13 +241,13 @@ func getOrderMoney(userId string, personnum, cycle int) int {
 		if kk[0] != "" && kk[1] != "" {
 			if personnum >= qutil.IntAll(kk[0]) && personnum <= qutil.IntAll(kk[1]) {
 				price = v
+				break
 			}
-			break
 		} else if kk[0] != "" && kk[1] == "" {
 			if personnum >= qutil.IntAll(kk[0]) {
 				price = v
+				break
 			}
-			break
 		}
 	}
 	if price == 0 {

+ 22 - 10
src/jfw/modules/subscribepay/src/service/orderListDetails.go

@@ -713,17 +713,29 @@ func FortyEightHoursCancel(order string, create_time_stamp, now_time_stamp int64
 func isEntExpire(userid string) 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))
-		if list != 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 {
-				startdate := qutil.Int64All(v["startdate"])
-				enddate := qutil.Int64All(v["enddate"])
-				now := time.Now().Unix()
-				if now >= startdate && now < enddate {
-					return true
+				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
+				}
+				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
+					}
 				}
 			}
 		}