瀏覽代碼

update

add_mode
DengBiao 1 年之前
父節點
當前提交
380eb13816
共有 3 個檔案被更改,包括 44 行新增2 行删除
  1. +41
    -0
      app/admin/hdl/hdl_demo.go
  2. +2
    -2
      app/customer/hdl/hdl_pay.go
  3. +1
    -0
      app/customer/md/md_curl_smart_pay.go

+ 41
- 0
app/admin/hdl/hdl_demo.go 查看文件

@@ -1,8 +1,12 @@
package hdl

import (
"applet/app/customer/md"
"applet/app/customer/svc"
"applet/app/db"
"applet/app/db/model"
"applet/app/e"
"applet/app/enum"
"fmt"
"github.com/gin-gonic/gin"
"time"
@@ -10,6 +14,43 @@ import (

// Demo 测试
func Demo(c *gin.Context) {
var m []model.CentralKitchenForSchoolPackageOrd
sess := db.Db.Desc("id").Where("state =1")
sess.Find(&m)
sysCfgDb := db.SysCfgDb{}
sysCfgDb.Set()
sysCfg := sysCfgDb.SysCfgFindWithDb(enum.JsapiPayAppAutToken, enum.OpenAlipayAppid, enum.OpenAlipayAppPrivateKey, enum.OpenAlipayPublicKey)

centralKitchenForSchoolPackageOrd := db.CentralKitchenForSchoolPackageOrd{}
for _, v := range m {
err2, result := svc.CurlAlipayTradeQuery(md.CurlAlipayTradeQueryReq{
Config: struct {
PayAliAppId string `json:"pay_ali_app_id" label:"支付宝开放平台-第三方应用-appid"`
PayAliPrivateKey string `json:"pay_ali_private_key" label:"支付宝开放平台-第三方应用-接口加签-应用私钥"`
PayAliPublicKey string `json:"pay_ali_public_key" label:"支付宝开放平台-第三方应用-接口加签-支付宝公钥"`
}{
PayAliAppId: sysCfg[enum.OpenAlipayAppid],
PayAliPrivateKey: sysCfg[enum.OpenAlipayAppPrivateKey],
PayAliPublicKey: sysCfg[enum.OpenAlipayPublicKey],
},
OutTradeNo: v.OutTradeNo,
AppAuthToken: sysCfg[enum.JsapiPayAppAutToken],
})
if err2 != nil {
e.OutErr(c, e.ERR, err2.Error())
return
}
centralKitchenForSchoolPackageOrd.Set(v.OutTradeNo)
v.CreateAt = result.Date
update, err := centralKitchenForSchoolPackageOrd.CentralKitchenForSchoolPackageOrdUpdate(&v, "create_at")
if err != nil {
e.OutErr(c, e.ERR, err.Error())
return
}

fmt.Println(">>>>>>>>>>>>", v.OutTradeNo, update)
}
return
qrcodeWithBatchRecordsDb := db.AdminDb{}
qrcodeWithBatchRecordsDb.Set()
data, _, err := qrcodeWithBatchRecordsDb.GetAdminRolePermission(1001)


+ 2
- 2
app/customer/hdl/hdl_pay.go 查看文件

@@ -56,8 +56,8 @@ func BuyPackageForWx(c *gin.Context) {
}
e.OutSuc(c, map[string]interface{}{
"out_trade_no": outTradeNo,
"prams": resp,
"total": total,
"prams": total,
"total": resp,
}, nil)
return
}


+ 1
- 0
app/customer/md/md_curl_smart_pay.go 查看文件

@@ -48,6 +48,7 @@ type CurlAlipayTradeQueryReq struct {

type CurlAlipayTradeQueryResp struct {
Code string `json:"code" label:"响应码"`
Date string `json:"date" label:"下单时间"`
Msg string `json:"msg" label:"响应消息"`
OutTradeNo string `json:"out_trade_no" label:"商户订单号"`
TradeNo string `json:"trade_no" label:"支付宝交易号"`


Loading…
取消
儲存