xuzhiheng 5 år sedan
förälder
incheckning
ace4004f43
2 ändrade filer med 6 tillägg och 6 borttagningar
  1. 5 6
      core/src/qfw/manage/refund.go
  2. 1 0
      core/src/web/templates/manage/vipOrderDetail.html

+ 5 - 6
core/src/qfw/manage/refund.go

@@ -43,12 +43,12 @@ func (d *Refund) RefundInfo(orderCode string) {
 			if len(*data) > 1 {
 				invoice_serialnum := util.ObjToString((*data)[1]["invoice_serialnum"])
 				if invoice_serialnum != "" {
-					RefundInvoice(invoice_serialnum)
+					go RefundInvoice(invoice_serialnum)
 				}
 			} else {
 				invoice_serialnum := util.ObjToString((*data)[0]["invoice_serialnum"])
 				if invoice_serialnum != "" {
-					RefundInvoice(invoice_serialnum)
+					go RefundInvoice(invoice_serialnum)
 				}
 			}
 		}
@@ -77,14 +77,13 @@ func RefundInvoice(invoice_serialnum string) {
 				response, _ := client.Do(request)
 				res, _ := ioutil.ReadAll(response.Body)
 				defer response.Body.Close()
-				result := map[string]interface{}{}
-				err := json.Unmarshal(res, &result)
+				result := util.ObjToMap(string(res))
 				if err != nil {
 					log.Println("json序列化错误")
 				} else {
-					if result["code"].(float64) == float64(0) {
+					if util.IntAll((*result)["code"]) == 0 {
 						refund_flag = 0
-					} else if result["code"].(float64) == float64(1) {
+					} else if util.IntAll((*result)["code"]) == 1 {
 						refund_flag = 1
 					} else {
 						refund_flag = 2

+ 1 - 0
core/src/web/templates/manage/vipOrderDetail.html

@@ -342,6 +342,7 @@
 	  var applybill_type = {{.T.res.applybill_type}};
 	  var applybill_company = {{.T.res.applybill_company}};
 	  var applybill_taxnum = {{.T.res.applybill_taxnum}};
+	  console.log(invoice)
 	  if(invoice !== null){
 	  		  var applyType = invoice[0].invoice_type;
 	  		  var taxpayer_identnum = invoice[0].taxpayer_identnum