|
@@ -334,8 +334,8 @@ func SendMailToBJFinance(order *map[string]interface{}, pay_time, transaction_id
|
|
|
subscription_area, industry, subscription_cycle, effective_date := "", "", "", ""
|
|
|
city_count := 0
|
|
|
filter := qutil.ObjToString((*order)["filter"])
|
|
|
- vip_starttime := qutil.ObjToString((*order)["vip_starttime"])[0:10]
|
|
|
- vip_endtime := qutil.ObjToString((*order)["vip_endtime"])[0:10]
|
|
|
+ vip_starttime := qutil.ObjToString((*order)["vip_starttime"])
|
|
|
+ vip_endtime := qutil.ObjToString((*order)["vip_endtime"])
|
|
|
vf := new(VipFilter)
|
|
|
err := json.Unmarshal([]byte(filter), &vf)
|
|
|
if err == nil && vf != nil {
|
|
@@ -366,27 +366,48 @@ func SendMailToBJFinance(order *map[string]interface{}, pay_time, transaction_id
|
|
|
} 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
|
|
|
+ }
|
|
|
+ } 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)
|
|
|
+ }
|
|
|
log.Println(subscription_cycle)
|
|
|
//有效日期
|
|
|
- vip_starttime = strings.Replace(vip_starttime, "-", ".", -1)
|
|
|
- vip_endtime = strings.Replace(vip_endtime, "-", ".", -1)
|
|
|
+ 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)
|
|
|
log.Println(effective_date)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
//vip
|
|
|
product_type = "VIP订阅"
|
|
|
mail_title = "电子发票申请-[剑鱼标讯]VIP订阅(" + order_code + ")"
|
|
|
-
|
|
|
- mailcontent = fmt.Sprintf(ExConf.Mail_vip_invoice_finance_content, bill_title, company_flag, bill_company, taxnum_flag, bill_taxnum, order_code, create_time, pay_time, pay_way, product_type, pay_money, subscription_area, industry, "订阅周期", effective_date)
|
|
|
+ mailcontent = fmt.Sprintf(ExConf.Mail_vip_invoice_finance_content, bill_title, company_flag, bill_company, taxnum_flag, bill_taxnum, order_code, create_time, pay_time, pay_way, product_type, pay_money, subscription_area, industry, subscription_cycle, effective_date)
|
|
|
}
|
|
|
}
|
|
|
//发送邮件
|