Browse Source

订单列表赠送日期

xuzhiheng 5 years ago
parent
commit
881793c24d

+ 4 - 0
src/jfw/front/dataExport.go

@@ -271,6 +271,10 @@ func (d *DataExport) QueryOrder() error {
 				if create_time.Unix() >= liveActiveStartTime && create_time.Unix() < liveActiveEndTime {
 					v["isLiveActive"] = true
 				}
+				activeData := public.Mysql.FindOne("prefer_active", map[string]interface{}{"order_code": v["order_code"], "user_id": v["user_id"]}, "active_code", "")
+				if activeData != nil {
+					v["isUsedActiveCode"] = true
+				}
 			}
 		}
 	}

+ 23 - 4
src/jfw/modules/app/src/web/templates/dataExport/dataExport_toMyOrder.html

@@ -1316,9 +1316,13 @@
 						var listhtml='';
 						for(var index in object){
 					   		var obj=object[index];
-							var isUsedActiveCode = false
+							var isUsedActiveCode = false;
+							var isLiveActive = false;
 							if(obj.isLiveActive){
-								isUsedActiveCode = true;
+								isLiveActive = true;
+							}
+							if(obj.isUsedActiveCode){
+							    isUsedActiveCode = true;
 							}
 							if(obj.product_type=="历史数据"){
 					    		count++;
@@ -1813,6 +1817,21 @@
 										iconHtml+='<div class="card-footer">'
 														+'</div>'
 		                        }
+                                if(filter_vip.cyclecount!=undefined&&filter_vip.cyclecount!=""&&filter_vip.cycleunit!=undefined&&filter_vip.cycleunit!=""){
+                                	if(parseInt(filter_vip.cycleunit)==1){
+                                		effectiveduration_vip=filter_vip.cyclecount+"年"
+                                	}else if(parseInt(filter_vip.cycleunit)==2){
+                                		effectiveduration_vip=filter_vip.cyclecount+"个月"
+                                	}else{
+                                		effectiveduration_vip="7天"
+                                	}
+                                }
+                                if(filter_vip.cycleunit==0&&filter_vip.cyclecount==0){
+                                	effectiveduration_vip="不延期";
+                                }
+                                if(isUsedActiveCode){
+                                    effectiveduration_vip = effectiveduration_vip+ '<span class="discount-container"><span>+</span><span class="highlight-text">赠送30天</span></span>'
+                                }
 		                        //vip状态 0不是vip 1试用 2正式
 		                        if (orderStatus_vip!="已完成"){
 		                        //未支付 或 已取消
@@ -1832,7 +1851,7 @@
 															+'<p class="item-ifo ellipsis">订阅周期:'+effectiveduration_vip+'</p>'
 														+'</div>'
 													+'</a>'
-									if(isUsedActiveCode){
+									if(isLiveActive){
                                         var activeDiscount = {{Msg "seo" "activeDiscount"}};
                                         var originPrice = (parseFloat(orderMoney_vip) / parseFloat(activeDiscount)).toFixed(2);
 										listhtml+= '<div class="price">'
@@ -1872,7 +1891,7 @@
 																	+'<p class="item-ifo ellipsis">有效日期:'+effectivetime_vip+'</p>'
 																+'</div>'
 															+'</a>'
-											if(isUsedActiveCode){
+											if(isLiveActive){
                                                 var activeDiscount = {{Msg "seo" "activeDiscount"}};
                                                 var originPrice = (parseFloat(orderMoney_vip) / parseFloat(activeDiscount)).toFixed(2);
 												listhtml+= '<div class="price">'

+ 10 - 2
src/web/templates/pc/myOrder.html

@@ -292,7 +292,8 @@
 								var deleteOrderHtml = "";
 								var keysHtml = "";
 								var prepaytime = obj.prepay_time;
-								var isLiveActive = obj.isLiveActive
+								var isLiveActive = obj.isLiveActive;
+                                var isUsedActiveCode = obj.isUsedActiveCode;
 								if (!obj.user_openid){
 									canUseWxpay=false;
 								}
@@ -541,7 +542,7 @@
 										if(parseInt(filter_.cycleunit)==1){
 											cycleT=filter_.cyclecount+"年"
 										}else if(parseInt(filter_.cycleunit)==2){
-											cycleT=filter_.cyclecount+"月"
+											cycleT=filter_.cyclecount+"月"
 										}else{
 											cycleT="7天"
 										}
@@ -549,6 +550,10 @@
 									if(filter_.cycleunit==0&&filter_.cyclecount==0){
 										cycleT="不延期";
 									}
+                                    
+                                    if(isUsedActiveCode){
+                                        cycleT = cycleT + '<span class="discount-container"><span> + </span><span class="highlight-text" style="color: #2cb7ca;">赠送30天</span></span>'
+                                    }
 									
 									if(obj.vip_endtime!=""&&obj.vip_starttime!=""){
 										obj.vip_starttime = formatTime(obj.vip_starttime) +" - "+formatTime(obj.vip_endtime)
@@ -622,6 +627,9 @@
 										var originPrice = (parseFloat(orderMoney) / 0.6).toFixed(2);
 										priceHtml = '<div style="line-height:106px;" class="fl m_number '+orderStatusClassOne+'"><p style="height:20px;text-decoration:line-through;color:#9B9CA3;">¥' + FormatNum(originPrice) + '</p><p>¥' + FormatNum(orderMoney) + '</p></div>';
 									}
+                                    if(isUsedActiveCode){
+                                        
+                                    }
 								}
 								temp += '<div class="order_list '+orderStatusClassOne+'">'
 										+'<div class="clearfix o_l_top '+orderStatusClassTwo+'">'

+ 23 - 4
src/web/templates/weixin/dataExport/dataExport_toMyOrder.html

@@ -542,10 +542,14 @@
         var psss = 0;
         for (var index in object) {
             var obj = object[index];
-			var isUsedActiveCode = false
+			var isUsedActiveCode = false;
+            var isLiveActive = false;
 			if(obj.isLiveActive){
-				isUsedActiveCode = true;
+				isLiveActive = true;
 			}
+            if(obj.isUsedActiveCode){
+                isUsedActiveCode = true;
+            }
             if (obj.product_type == "历史数据") {
                 count++;
                 var id = obj.id;
@@ -1155,6 +1159,21 @@
                     iconHtml += '<div class="card-footer">'
                         + '</div>'
                 }
+                if(filter_vip.cyclecount!=undefined&&filter_vip.cyclecount!=""&&filter_vip.cycleunit!=undefined&&filter_vip.cycleunit!=""){
+                	if(parseInt(filter_vip.cycleunit)==1){
+                		effectiveduration_vip=filter_vip.cyclecount+"年"
+                	}else if(parseInt(filter_vip.cycleunit)==2){
+                		effectiveduration_vip=filter_vip.cyclecount+"个月"
+                	}else{
+                		effectiveduration_vip="7天"
+                	}
+                }
+                if(filter_vip.cycleunit==0&&filter_vip.cyclecount==0){
+                	effectiveduration_vip="不延期";
+                }
+                if(isUsedActiveCode){
+                    effectiveduration_vip = effectiveduration_vip+ '<span class="discount-container"><span>+</span><span class="highlight-text">赠送30天</span></span>'
+                }
                 //vip状态 0不是vip 1试用 2正式
                 if (orderStatus_vip != "已完成") {
                     //未支付 或 已取消
@@ -1174,7 +1193,7 @@
                         + '<p class="item-ifo ellipsis">订阅周期:' + effectiveduration_vip + '</p>';
                     //}
                     listhtml += '</div></a>'
-					if(isUsedActiveCode){
+					if(isLiveActive){
                         var activeDiscount = {{Msg "seo" "activeDiscount"}};
 						var originPrice = (parseFloat(orderMoney_vip) / parseFloat(activeDiscount)).toFixed(2);
 						listhtml += '<div class="price">'
@@ -1214,7 +1233,7 @@
                         + '<p class="item-ifo ellipsis">有效日期:' + effectivetime_vip + '</p>';
                     //}
                     listhtml += '</div></a>'
-                    if(isUsedActiveCode){
+                    if(isLiveActive){
 						var activeDiscount = {{Msg "seo" "activeDiscount"}};
 						var originPrice = (parseFloat(orderMoney_vip) / parseFloat(activeDiscount)).toFixed(2);
                     	listhtml += '<div class="price">'