|
@@ -340,15 +340,16 @@ func SendMailToBJFinance(order *map[string]interface{}, pay_time, transaction_id
|
|
|
}
|
|
|
}
|
|
|
//vip开发票内容
|
|
|
- subscription_area, industry, subscription_cycle, effective_date := "", "", "", ""
|
|
|
+ subscription_area, industry, subscription_cycle, effective_date, payment_number := "", "", "", "", ""
|
|
|
city_count := 0
|
|
|
filter := qutil.ObjToString((*order)["filter"])
|
|
|
vip_starttime := qutil.ObjToString((*order)["vip_starttime"])
|
|
|
vip_endtime := qutil.ObjToString((*order)["vip_endtime"])
|
|
|
+ payment_number = getPayTransactionId(qutil.ObjToString((*order)["pay_way"]), qutil.ObjToString((*order)["out_trade_no"]))
|
|
|
+ vip_type := qutil.Int64All((*order)["vip_type"]) //判断 续费 升级订单
|
|
|
vf := new(VipFilter)
|
|
|
err := json.Unmarshal([]byte(filter), &vf)
|
|
|
if err == nil && vf != nil {
|
|
|
- log.Println(vf.Area)
|
|
|
vip_area := vf.Area //区域
|
|
|
vip_ind := vf.Industry //行业
|
|
|
nbs := JyVipSubStruct.NewBuySet(&vip_area, vip_ind)
|
|
@@ -409,19 +410,22 @@ func SendMailToBJFinance(order *map[string]interface{}, pay_time, transaction_id
|
|
|
} else if year > 0 && month == 0 {
|
|
|
subscription_cycle = fmt.Sprintf("%d年", year)
|
|
|
}
|
|
|
- log.Println(subscription_cycle)
|
|
|
//有效日期
|
|
|
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订阅"
|
|
|
+ if vip_type == 1 {
|
|
|
+ product_type = "VIP订阅(续费)"
|
|
|
+ } else if vip_type == 2 {
|
|
|
+ product_type = "VIP订阅(升级)"
|
|
|
+ } else {
|
|
|
+ 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, user_email, order_code, create_time, 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, subscription_area, industry, subscription_cycle, effective_date)
|
|
|
}
|
|
|
}
|
|
|
//发送邮件
|
|
@@ -762,3 +766,26 @@ func GetBrforeMsg(userId, openId string) (name, phone, company, email string) {
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+//获取支付单号
|
|
|
+func getPayTransactionId(payWay, tradeNo string) (transaction_id string) {
|
|
|
+ if payWay == "" || tradeNo == "" {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ table := ""
|
|
|
+ if strings.HasPrefix(payWay, "wx") {
|
|
|
+ table = "weixin_pay"
|
|
|
+ } else if strings.HasPrefix(payWay, "ali") {
|
|
|
+ table = "ali_pay"
|
|
|
+ } else {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ query := map[string]interface{}{
|
|
|
+ "out_trade_no": tradeNo,
|
|
|
+ }
|
|
|
+ r := util.Mysql.FindOne(table, query, "transaction_id", "")
|
|
|
+ if r != nil {
|
|
|
+ transaction_id = qutil.ObjToString((*r)["transaction_id"])
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|