|
@@ -957,6 +957,7 @@ func (this *Invoice) Invoiceinfo() {
|
|
|
countdowntime := config.Config.OrderCountdown.(string)
|
|
|
status := util.Mysql.FindOne("dataexport_order", data, "", "")
|
|
|
if *status != nil {
|
|
|
+ (*status)["userLotteryId"] = LastInvoiceSource(qutil.InterfaceToStr((*status)["order_code"]))
|
|
|
//卡卷id加密
|
|
|
if (*status)["d_relation_id"] != "" {
|
|
|
(*status)["userLotteryId"] = encrypt.SE.Encode2Hex(qutil.ObjToString((*status)["d_relation_id"]))
|
|
@@ -999,6 +1000,14 @@ func InvoiceSendMail(target_mail, html, title string) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// 查询订单最后开票状态
|
|
|
+func LastInvoiceSource(orderCode string) int64 {
|
|
|
+ orderData := util.Mysql.SelectBySql("select source from invoice where order_code =? ORDER BY create_time desc ", orderCode)
|
|
|
+ if orderData != nil && len(*orderData) > 0 {
|
|
|
+ return qutil.Int64All((*orderData)[0]["source"])
|
|
|
+ }
|
|
|
+ return 0
|
|
|
+}
|
|
|
func (this *Invoice) Available() {
|
|
|
u := util.Mysql.FindOne("dataexport_order", map[string]interface{}{"order_code": this.GetString("order_code")}, "pay_time", "")
|
|
|
status := 0
|
|
@@ -1080,6 +1089,7 @@ func (this *Invoice) InvoiceSubmit() {
|
|
|
"invoice_content": "信息技术服务-技术服务费",
|
|
|
"invoice_status": 0,
|
|
|
"invoice_changed": 0,
|
|
|
+ "invoice_order_code": strings.Join(orderArr, ","),
|
|
|
"company_phone": this.GetString("company_phone"),
|
|
|
"taxpayer_identnum": this.GetString("taxpayer_identnum"),
|
|
|
"create_time": time.Now().Unix(),
|
|
@@ -1299,7 +1309,6 @@ func InvoiceStatusHandle(orderCode string) bool {
|
|
|
|
|
|
// 电子普票发邮箱
|
|
|
func sendMail(invoiceType, orderCode, companyName, taxpayerIdentnum, mail, phone, url string) {
|
|
|
- url = "https://www.baidu.com/index.php?tn=monline_3_dg"
|
|
|
if invoiceType == "个人" {
|
|
|
emailHtml := emailHtml_gr
|
|
|
emailHtmls := fmt.Sprintf(emailHtml, phone, mail)
|