zhangxinlei1996 5 жил өмнө
parent
commit
2bbec7ce80

+ 7 - 6
src/jfw/front/shorturl.go

@@ -90,6 +90,12 @@ func (s *Short) Article(stype, id string) error {
 		data1, _ := mongodb.FindOneByField("user", bson.M{"s_m_openid": ssOpenid}, `{"_id":1}`)
 		userId = util.BsonIdToSId((*data1)["_id"])
 	}
+	//判断用户是否是vip
+	res, _ := public.MQFW.FindById("user", userId, nil)
+	if util.IntAll((*res)["i_vip_status"]) == 1 || util.IntAll((*res)["i_vip_status"]) == 2 {
+		isVip = true
+	}
+	s.T["isVip"] = isVip
 	if bm {
 		//判断有没有取关,取关的话,跳转到关于剑鱼标讯页面
 		if ssOpenid != nil && ssOpenid != "" {
@@ -130,12 +136,7 @@ func (s *Short) Article(stype, id string) error {
 		} else {
 			s.T["openid"] = se.EncodeString(myopenid) //"-1"
 		}
-		//判断用户是否是vip
-		res, _ := public.MQFW.FindById("user", userId, nil)
-		if util.IntAll((*res)["i_vip_status"]) == 1 || util.IntAll((*res)["i_vip_status"]) == 2 {
-			isVip = true
-		}
-		s.T["isVip"] = isVip
+
 		mynickname, _ := s.GetSession("s_nickname").(string)
 		myavatar, _ := s.GetSession("s_avatar").(string)
 		s.T["nickname"] = mynickname

+ 7 - 5
src/jfw/modules/subscribepay/src/entity/dataExportSearch.go

@@ -47,11 +47,13 @@ type SieveCondition struct {
 
 //VIP订单
 type VipFilter struct {
-	Area       map[string]interface{} `json:"area"`     //地区
-	Industry   []string               `json:"industry"` //
-	Cyclecount int                    `json:"cyclecount"`
-	Cycleunit  int                    `json:"cycleunit"`
-	ordertype  int                    `json:"ordertype"`
+	Area        map[string]interface{} `json:"area"`     //地区
+	Industry    []string               `json:"industry"` //
+	Cyclecount  int                    `json:"cyclecount"`
+	Cycleunit   int                    `json:"cycleunit"`
+	Ordertype   int                    `json:"ordertype"`
+	Addarea     map[string]interface{} `json:"addarea"`     //新增地区
+	Addindustry []string               `json:"addindustry"` //新增行业
 }
 
 const (

+ 110 - 55
src/jfw/modules/subscribepay/src/entity/dataexport.go

@@ -341,6 +341,7 @@ func SendMailToBJFinance(order *map[string]interface{}, pay_time, transaction_id
 			}
 			//vip开发票内容
 			subscription_area, industry, subscription_cycle, effective_date, payment_number := "", "", "", "", ""
+			display_a, display_b, display_c := "none", "none", "none" //a:正常购买 b:续费 c:升级
 			city_count := 0
 			filter := qutil.ObjToString((*order)["filter"])
 			vip_starttime := qutil.ObjToString((*order)["vip_starttime"])
@@ -350,82 +351,136 @@ func SendMailToBJFinance(order *map[string]interface{}, pay_time, transaction_id
 			vf := new(VipFilter)
 			err := json.Unmarshal([]byte(filter), &vf)
 			if err == nil && vf != nil {
-				vip_area := vf.Area    //区域
-				vip_ind := vf.Industry //行业
-				nbs := JyVipSubStruct.NewBuySet(&vip_area, vip_ind)
-				if nbs != nil {
-					if nbs.Citys != nil {
-						for _, v := range nbs.Citys {
-							city_count += v.(int)
+				if vip_type == 2 { //升级查新订单
+					addarea := vf.Addarea         //区域
+					addindustry := vf.Addindustry //行业
+					log.Println(addarea)
+					//升级区域显示
+					if (addarea)["no"] != "no" {
+						addarea_upgrade := JyVipSubStruct.NewBuySet(&addarea, addindustry)
+						if addarea_upgrade != nil {
+							if addarea_upgrade.Citys != nil {
+								for _, v := range addarea_upgrade.Citys {
+									city_count += v.(int)
+								}
+							}
+							//订阅区域
+							if addarea_upgrade.AreaCount == -1 {
+								subscription_area = "全国"
+							} else {
+								if city_count != 0 && addarea_upgrade.AreaCount == 0 {
+									subscription_area = fmt.Sprintf("%d个地市", city_count)
+								} else if city_count == 0 && addarea_upgrade.AreaCount != 0 {
+									subscription_area = fmt.Sprintf("%d个省级区域", addarea_upgrade.AreaCount)
+								} else if city_count != 0 && addarea_upgrade.AreaCount != 0 {
+									subscription_area = fmt.Sprintf("%d个省级区域、%d个地市", addarea_upgrade.AreaCount, city_count)
+								}
+							}
 						}
-					}
-					//订阅区域
-					if nbs.AreaCount == -1 {
-						subscription_area = "全国"
 					} else {
-						if city_count != 0 && nbs.AreaCount == 0 {
-							subscription_area = fmt.Sprintf("%d个地市", city_count)
-						} else if city_count == 0 && nbs.AreaCount != 0 {
-							subscription_area = fmt.Sprintf("%d个省级区域", nbs.AreaCount)
-						} else if city_count != 0 && nbs.AreaCount != 0 {
-							subscription_area = fmt.Sprintf("%d个省级区域、%d个地市", nbs.AreaCount, city_count)
+						subscription_area = "无"
+					}
+
+					//升级行业显示
+					industry_upgrade := 0
+					if len(addindustry) != 0 {
+						if addindustry[0] != "no" { //等于no 为 无新增区域
+							industry_upgrade = len(addindustry)
+						} else {
+							industry_upgrade = -2 //无新增
 						}
+					} else {
+						industry_upgrade = -1 //全行业
 					}
-					//行业
-					if nbs.BuyerclassCount != -1 {
-						industry = fmt.Sprintf("%d个行业", nbs.BuyerclassCount)
+					if industry_upgrade != -1 && industry_upgrade != -2 {
+						industry = fmt.Sprintf("%d个行业", industry_upgrade)
+					} else if industry_upgrade == -2 {
+						industry = "无"
 					} else {
 						industry = "全行业"
 					}
-					// 订阅周期 有效日期
-					if vip_endtime != "" && vip_starttime != "" {
-						year := 0
-						month := 0
-						//订阅周期
-						vip_starttime_stamp, _ := time.ParseInLocation(qutil.Date_Full_Layout, vip_starttime, time.Local)
-						vip_endtime_stamp, _ := time.ParseInLocation(qutil.Date_Full_Layout, vip_endtime, time.Local)
-						start_year := time.Unix(qutil.Int64All(vip_starttime_stamp.Unix()), 0).Year()
-						end_year := time.Unix(qutil.Int64All(vip_endtime_stamp.Unix()), 0).Year()
-						start_month := int(time.Unix(qutil.Int64All(vip_starttime_stamp.Unix()), 0).Month())
-						end_month := int(time.Unix(qutil.Int64All(vip_endtime_stamp.Unix()), 0).Month())
-						if end_year > start_year {
-							if end_month > start_month {
-								year = end_year - start_year
-								month = end_month - start_month
-							} else {
-								year = end_year - start_year - 1
-								month = 12 + end_month - start_month
-								if month == 12 {
-									year++
-									month = 0
-								}
+				} else { //非升级
+					vip_area := vf.Area    //区域
+					vip_ind := vf.Industry //行业
+					nbs := JyVipSubStruct.NewBuySet(&vip_area, vip_ind)
+					if nbs != nil {
+						if nbs.Citys != nil {
+							for _, v := range nbs.Citys {
+								city_count += v.(int)
+							}
+						}
+						//订阅区域
+						if nbs.AreaCount == -1 {
+							subscription_area = "全国"
+						} else {
+							if city_count != 0 && nbs.AreaCount == 0 {
+								subscription_area = fmt.Sprintf("%d个地市", city_count)
+							} else if city_count == 0 && nbs.AreaCount != 0 {
+								subscription_area = fmt.Sprintf("%d个省级区域", nbs.AreaCount)
+							} else if city_count != 0 && nbs.AreaCount != 0 {
+								subscription_area = fmt.Sprintf("%d个省级区域、%d个地市", nbs.AreaCount, city_count)
 							}
-						} else if end_year == start_year {
-							month = end_month - start_month
 						}
-						if year == 0 && month > 0 {
-							subscription_cycle = fmt.Sprintf("%d个月", month)
-						} else if year > 0 && month > 0 {
-							subscription_cycle = fmt.Sprintf("%d年%d个月", year, month)
-						} else if year > 0 && month == 0 {
-							subscription_cycle = fmt.Sprintf("%d年", year)
+						//行业
+						if nbs.BuyerclassCount != -1 {
+							industry = fmt.Sprintf("%d个行业", nbs.BuyerclassCount)
+						} else {
+							industry = "全行业"
+						}
+					}
+				}
+
+				// 订阅周期 有效日期
+				if vip_endtime != "" && vip_starttime != "" {
+					year := 0
+					month := 0
+					//订阅周期
+					vip_starttime_stamp, _ := time.ParseInLocation(qutil.Date_Full_Layout, vip_starttime, time.Local)
+					vip_endtime_stamp, _ := time.ParseInLocation(qutil.Date_Full_Layout, vip_endtime, time.Local)
+					start_year := time.Unix(qutil.Int64All(vip_starttime_stamp.Unix()), 0).Year()
+					end_year := time.Unix(qutil.Int64All(vip_endtime_stamp.Unix()), 0).Year()
+					start_month := int(time.Unix(qutil.Int64All(vip_starttime_stamp.Unix()), 0).Month())
+					end_month := int(time.Unix(qutil.Int64All(vip_endtime_stamp.Unix()), 0).Month())
+					if end_year > start_year {
+						if end_month > start_month {
+							year = end_year - start_year
+							month = end_month - start_month
+						} else {
+							year = end_year - start_year - 1
+							month = 12 + end_month - start_month
+							if month == 12 {
+								year++
+								month = 0
+							}
 						}
-						//有效日期
-						vip_starttime = strings.Replace(vip_starttime[0:10], "-", ".", -1)
-						vip_endtime = strings.Replace(vip_endtime[0:10], "-", ".", -1)
-						effective_date = fmt.Sprintf("%v-%v", vip_starttime, vip_endtime)
+					} else if end_year == start_year {
+						month = end_month - start_month
+					}
+					if year == 0 && month > 0 {
+						subscription_cycle = fmt.Sprintf("%d个月", month)
+					} else if year > 0 && month > 0 {
+						subscription_cycle = fmt.Sprintf("%d年%d个月", year, month)
+					} else if year > 0 && month == 0 {
+						subscription_cycle = fmt.Sprintf("%d年", year)
 					}
+					//有效日期
+					vip_starttime = strings.Replace(vip_starttime[0:10], "-", ".", -1)
+					vip_endtime = strings.Replace(vip_endtime[0:10], "-", ".", -1)
+					effective_date = fmt.Sprintf("%v-%v", vip_starttime, vip_endtime)
 				}
 			}
 			if vip_type == 1 {
 				product_type = "VIP订阅(续费)"
+				display_b = "block"
 			} else if vip_type == 2 {
 				product_type = "VIP订阅(升级)"
+				display_c = "block"
 			} else {
 				product_type = "VIP订阅"
+				display_a = "block"
 			}
 			mail_title = "电子发票申请-[剑鱼标讯]VIP订阅(" + order_code + ")"
-			mailcontent = fmt.Sprintf(ExConf.Mail_vip_invoice_finance_content, bill_title, company_flag, bill_company, taxnum_flag, bill_taxnum, user_email, order_code, create_time, payment_number, pay_time, pay_way, product_type, pay_money, subscription_area, industry, subscription_cycle, effective_date)
+			mailcontent = fmt.Sprintf(ExConf.Mail_vip_invoice_finance_content, bill_title, company_flag, bill_company, taxnum_flag, bill_taxnum, user_email, order_code, create_time, payment_number, pay_time, pay_way, product_type, pay_money, display_a, subscription_area, industry, subscription_cycle, display_b, subscription_area, industry, subscription_cycle, display_c, subscription_area, industry, subscription_cycle, effective_date)
 		}
 	}
 	//发送邮件

+ 21 - 1
src/web/templates/pc/biddetail.html

@@ -196,6 +196,18 @@ a{
 .j-content.limitshare .com-prebuilt .jykeyword-border{
 	border-bottom:1px solid rgba(44,183,202,.2);
 }
+
+.com-buyerclass{
+	background-color: #CFAD89;
+    border-radius: 3px;
+    color: #fff;
+    padding: 1px 6px 2px 6px;
+    margin-right: 5px;
+    font-size: 14px;
+}
+.com-buyerclass > a{
+    color: #fff;
+}
 </style>
 </head>
 <body>
@@ -361,7 +373,7 @@ function isWechat() {
 			</div>-->
 		</div>
 		<center class="reward text-align">
-			<br><div>打赏</div>
+			<br><div>打赏</div>
 		</center>
 		{{if .T.obj.urltop}}<a class="trs" style="color:white"> </a>{{end}}
 		{{if .T.isForceShare}}
@@ -908,6 +920,7 @@ var thishtlists_ent = function(){
         })
     });
 }
+
 //
 var thishtlists = function(){
 	var _id = {{.T.obj._id}};
@@ -1092,6 +1105,7 @@ var type = {{.T.obj.subtype}};
 var area = {{.T.obj.area}};
 //var industry = {{.T.obj.industry}};
 var subscopeclass = {{.T.obj.s_subscopeclass}};
+var buyerclass={{.T.obj.buyerclass}}
 
 if (area !="" && area != "A"){
 	$(".com-statusbar").append('<span class="com-area"><a href="/list/area/'+{{.T.obj.areaadd}}+'.html">'+area+'</a></span>');
@@ -1120,6 +1134,12 @@ if(industry && industry!="undefined"){
 	$(".com-statusbar").append('<span class="com-industry"><a href="/list/industry/'+{{.T.obj.indadd}}+'.html">'+suclass.split("_")[0]+'</a></span>');
 }
 //
+if ({{.T.isVip}}){
+	if(buyerclass){
+		$(".com-statusbar").append('<span class="com-buyerclass"><a>'+buyerclass+'</a></span>');
+	}
+}
+//
 if(publishtime != ""){
 	var diff = timeDiff(new Date(Number(publishtime+"000")));
 	if(diff != null){

+ 18 - 0
src/web/templates/pc/biddetail_rec.html

@@ -189,6 +189,17 @@ a{
 	background: #fff;
     border-bottom: 1px solid #e0e0e0;
 }
+.com-buyerclass{
+	background-color: #CFAD89;
+    border-radius: 3px;
+    color: #fff;
+    padding: 1px 6px 2px 6px;
+    margin-right: 5px;
+    font-size: 14px;
+}
+.com-buyerclass > a{
+    color: #fff;
+}
 </style>
 </head>
 <body>
@@ -1678,6 +1689,7 @@ var area = {{.T.obj.area}};
 //var industry = {{.T.obj.industry}};
 var industry = getQueryString("industry");
 var subscopeclass = {{.T.obj.s_subscopeclass}};
+var buyerclass ={{.T.obj.buyerclass}};
 
 if (area !="" && area != "A"){
 	$(".com-statusbar").append('<span class="com-area"><a href="/list/area/'+{{.T.obj.areaadd}}+'.html">'+area+'</a></span>');
@@ -1706,6 +1718,12 @@ if(industry && industry!="undefined"){
 	$(".com-statusbar").append('<span class="com-industry"><a href="/list/industry/'+{{.T.obj.indadd}}+'.html">'+suclass.split("_")[0]+'</a></span>');
 }
 //
+if ({{.T.isVip}}){
+	if(buyerclass){
+		$(".com-statusbar").append('<span class="com-buyerclass"><a>'+buyerclass+'</a></span>');
+	}
+}
+//
 if(publishtime != ""){
 	var diff = timeDiff(new Date(Number(publishtime+"000")));
 	if(diff != null){

+ 47 - 7
src/web/templates/weixin/vipsubscribe/vip_order_detail.html

@@ -230,6 +230,7 @@ try{
         //订单条件        
         if(r.data.order.filter){
             var filterObj=JSON.parse(r.data.order.filter);
+        	if (r.data.order.vip_type!=2){
             //省份数 城市数
             if(!$.isEmptyObject(filterObj.area)){
               var cityNum=0;
@@ -252,14 +253,53 @@ try{
             }else{
               $(".areaNum").text("全国");
             }
-         
+            //行业数
+	        if(filterObj.industry.length!=0){
+	            $(".industryNum").text(filterObj.industry.length+"个行业");
+	        }else{
+	            $(".industryNum").text("全行业");
+	        }
+         }else{
+         	//升级订单 单独处理
+         	if(!$.isEmptyObject(filterObj.addarea)){
+              var cityNum_u=0;
+              var provinceNum_u=0;
+         	for(var i in filterObj.addarea) {
+                let citys_u=filterObj.addarea[i];
+                if (citys_u=="no"){
+                	$(".areaNum").text("无");
+                }
+                if (citys_u.length>0){
+                	cityNum_u+=citys_u.length;
+                }else{
+                	provinceNum_u++;
+                }
+                var areaText_u="";//1个省级区域、4个地市
+                if(provinceNum_u>0) areaText_u= areaText_u + provinceNum_u+"个省级区域";
+                if(cityNum_u>0){
+                  if(provinceNum_u>0) areaText_u= areaText_u+"、"
+                  areaText_u = areaText_u+ cityNum_u+"个地市";
+                }
+              $(".areaNum").text(areaText_u);
+              }
+         	}else {
+         		$(".areaNum").text("全国");
+         	}
+         	//行业
+         	
+         	if(filterObj.addindustry[0]=="no"){
+         		$(".industryNum").text("无");
+         	}else{
+         		if(filterObj.addindustry.length==0){
+         			$(".industryNum").text("全行业");
+         		}else{
+         			$(".industryNum").text(filterObj.addindustry.length+"个行业");
+         		}
+         	}
+         	
+         }
+          
           
-          //行业数
-          if(filterObj.industry.length!=0){
-            $(".industryNum").text(filterObj.industry.length+"个行业");
-          }else{
-            $(".industryNum").text("全行业");
-          }
           
         }