|
@@ -211,6 +211,7 @@ func SendMailToBJFinance(order *map[string]interface{}, pay_time, transaction_id
|
|
|
user_phone := util.ObjToString((*order)["user_phone"])
|
|
|
data_spec := util.ObjToString((*order)["data_spec"])
|
|
|
data_count := util.IntAll((*order)["data_count"])
|
|
|
+ pay_way := util.ObjToString((*order)["pay_way"])
|
|
|
//
|
|
|
create_time := util.ObjToString((*order)["create_time"])
|
|
|
if create_time != "" {
|
|
@@ -221,15 +222,28 @@ func SendMailToBJFinance(order *map[string]interface{}, pay_time, transaction_id
|
|
|
product_type := util.ObjToString((*order)["product_type"]) + "导出"
|
|
|
//
|
|
|
order_money := float64(util.IntAll((*order)["order_money"])) / 100
|
|
|
- if transaction_id == "" && util.ObjToString((*order)["pay_way"]) == "微信" { //线下支付没有微信订单编号
|
|
|
- out_trade_no := util.ObjToString((*order)["out_trade_no"])
|
|
|
- wxpaydata := Mysql.FindOne("weixin_pay", map[string]interface{}{
|
|
|
- "out_trade_no": out_trade_no,
|
|
|
- }, "transaction_id", "")
|
|
|
- if wxpaydata != nil && len(*wxpaydata) > 0 {
|
|
|
- transaction_id = util.ObjToString((*wxpaydata)["transaction_id"])
|
|
|
- }
|
|
|
+
|
|
|
+ if transaction_id == "" {
|
|
|
+ transaction_id = func() string {
|
|
|
+ table := ""
|
|
|
+ if util.ObjToString((*order)["pay_way"]) == "微信" {
|
|
|
+ table = "weixin_pay"
|
|
|
+ } else if util.ObjToString((*order)["pay_way"]) == "支付宝" {
|
|
|
+ table = "ali_pay"
|
|
|
+ } else {
|
|
|
+ return ""
|
|
|
+ }
|
|
|
+ out_trade_no := util.ObjToString((*order)["out_trade_no"])
|
|
|
+ wxpaydata := Mysql.FindOne(table, map[string]interface{}{
|
|
|
+ "out_trade_no": out_trade_no,
|
|
|
+ }, "transaction_id", "")
|
|
|
+ if wxpaydata != nil && len(*wxpaydata) > 0 { //线下支付没有微信订单编号
|
|
|
+ return util.ObjToString((*wxpaydata)["transaction_id"])
|
|
|
+ }
|
|
|
+ return ""
|
|
|
+ }()
|
|
|
}
|
|
|
+
|
|
|
mailcontent := ""
|
|
|
var mail_title = ""
|
|
|
if mailType == 1 { //支付完成后给北京财务发送导出数据接口信息的邮件
|
|
@@ -277,7 +291,7 @@ func SendMailToBJFinance(order *map[string]interface{}, pay_time, transaction_id
|
|
|
log.Println("用户筛选条件错误", err, sc)
|
|
|
}
|
|
|
mail_title = "剑鱼标讯历史数据订单【" + order_code + "】,请查收"
|
|
|
- mailcontent = fmt.Sprintf(ExConf.Mail_order_finance_content, order_code, create_time, pay_time, product_type, transaction_id, data_spec, data_count, order_money, user_mail, user_phone, publishtime, region, industry, keys, sc_money, subtype, buyer, winner)
|
|
|
+ mailcontent = fmt.Sprintf(ExConf.Mail_order_finance_content, order_code, create_time, pay_time, product_type, pay_way, transaction_id, data_spec, data_count, order_money, user_mail, user_phone, publishtime, region, industry, keys, sc_money, subtype, buyer, winner)
|
|
|
} else {
|
|
|
//申请发票
|
|
|
pay_time = util.ObjToString((*order)["pay_time"])
|
|
@@ -318,7 +332,7 @@ func SendMailToBJFinance(order *map[string]interface{}, pay_time, transaction_id
|
|
|
}
|
|
|
}
|
|
|
mail_title = "电子发票申请,剑鱼标讯历史数据订单【" + order_code + "】,请查收"
|
|
|
- mailcontent = fmt.Sprintf(ExConf.Mail_invoice_finance_content, bill_title, company_flag, bill_company, taxnum_flag, bill_taxnum, order_code, create_time, pay_time, product_type, transaction_id, offlineImgSrc, data_spec, data_count, order_money, user_mail, user_phone)
|
|
|
+ mailcontent = fmt.Sprintf(ExConf.Mail_invoice_finance_content, bill_title, company_flag, bill_company, taxnum_flag, bill_taxnum, order_code, create_time, pay_time, product_type, pay_way, transaction_id, offlineImgSrc, data_spec, data_count, order_money, user_mail, user_phone)
|
|
|
}
|
|
|
//发送邮件
|
|
|
for _, finance_mail := range ExConf.Finance_emails {
|