黄梓健 5 years ago
parent
commit
629c581262
  1. 3
      controllers/client/sign.go
  2. 40
      log/hdzj.log
  3. 8
      models/module_service_history.go
  4. 82
      services/pay/bindata.go
  5. 6
      services/pay/client.go
  6. 2
      test/order_test.go

3
controllers/client/sign.go

@ -68,8 +68,7 @@ func (t *SignCtl) Setting() {
exist, err := service.GetByName(define.MODULE_SIGNIN)
t.CheckErr(err)
t.Assert(exist, code.MSG_MODULE_NOT_EXIST, "签到模块不存在")
historyIds := make([]int64, 0)
err = models.GetModuleServiceHistoryIdsByIdAndName(&historyIds, service.Id, service.Name)
historyIds, err := models.GetModuleServiceHistoryIdsByIdAndName(service.Id, service.Name)
t.CheckErr(err)
module := new(models.ActivityModuleService)

40
log/hdzj.log

@ -108,3 +108,43 @@
2020-05-22 17:43:01.374 ERROR logger/logger.go:87 不存在客户订单: err-> invalid connection, out_trade_no->grc418sZOaBZsQDzbIeMPjafk3E6Z1sl
2020-05-22 17:43:01.374 ERROR logger/logger.go:87 check err{error 25 0 invalid connection}
2020-05-22 17:43:01.375 ERROR logger/logger.go:87 check err{error 25 0 invalid connection}
2020-05-28 10:41:14.507 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:41:14.507 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:41:14.551 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:41:14.570 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:41:14.570 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:41:14.571 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:41:14.967 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:41:14.980 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:41:15.003 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:41:15.004 ERROR logger/logger.go:87 直播红包信息异常: err-> <nil>, exist->false, status->1, out_trade_no->RtEZev6Lw21fp2BzGNpvrSxMRgIn7204
2020-05-28 10:45:29.093 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:45:29.093 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:45:29.134 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:45:29.134 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:45:29.134 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:45:29.145 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:45:29.565 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:45:29.569 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:45:29.601 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:45:29.601 ERROR logger/logger.go:87 直播红包信息异常: err-> <nil>, exist->false, status->1, out_trade_no->RtEZev6Lw21fp2BzGNpvrSxMRgIn7204
2020-05-28 10:47:54.752 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:47:54.752 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:47:54.780 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:47:54.789 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:47:54.793 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:47:54.796 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:47:55.024 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:47:55.025 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:47:55.057 ERROR logger/logger.go:87 直播红包信息异常: err-> <nil>, exist->false, status->1, out_trade_no->RtEZev6Lw21fp2BzGNpvrSxMRgIn7204
2020-05-28 10:47:55.060 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:51:38.483 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:51:38.483 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:51:38.518 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:51:38.522 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:51:38.531 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:51:38.532 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:51:38.886 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:51:38.887 ERROR logger/logger.go:87 直播红包信息异常: err-> <nil>, exist->false, status->1, out_trade_no->RtEZev6Lw21fp2BzGNpvrSxMRgIn7204
2020-05-28 10:51:38.938 ERROR logger/logger.go:87 客户订单异常
2020-05-28 10:51:38.969 ERROR logger/logger.go:87 客户订单异常

8
models/module_service_history.go

@ -37,7 +37,9 @@ func (t *ModuleServiceHistory) ExistSignModule(ids []interface{}) (bool, error)
return core.GetXormAuto().Where("is_delete=0 and name=?", "签到").In("id", ids...).Exist(t)
}
func GetModuleServiceHistoryIdsByIdAndName(obj, serviceId, serviceName interface{}) error {
return core.GetXormAuto().Table(new(ModuleServiceHistory)).Select("id").
Where("is_delete=0 and service_module_id=? and name=?", serviceId, serviceName).Find(&obj)
func GetModuleServiceHistoryIdsByIdAndName(serviceId, serviceName interface{}) ([]int64, error) {
historyIds := make([]int64, 0)
err := core.GetXormAuto().Table(new(ModuleServiceHistory)).Select("id").
Where("is_delete=0 and service_module_id=? and name=?", serviceId, serviceName).Find(&historyIds)
return historyIds, err
}

82
services/pay/bindata.go
File diff suppressed because it is too large
View File

6
services/pay/client.go

@ -12,15 +12,15 @@ import (
// 配置 client
func Client() (*core.Client, error) {
certP12, err := Asset("cacert/apiclient_cert.p12")
certP12, err := Asset("apiclient_cert.p12")
if err != nil {
return nil, err
}
certPem, err := Asset("cacert/apiclient_cert.pem")
certPem, err := Asset("apiclient_cert.pem")
if err != nil {
return nil, err
}
keyPem, err := Asset("cacert/apiclient_key.pem")
keyPem, err := Asset("apiclient_key.pem")
if err != nil {
return nil, err
}

2
test/order_test.go

@ -17,7 +17,7 @@ func TestUnifiedOrder(t *testing.T) {
}
func TestRefund(t *testing.T) {
res, err := pay_service.Refund("测试退款", "qfdyD0vJRHP2xJeoaerSWrGMXDacd5wo")
res, err := pay_service.Refund("测试退款", "ZxzwZv6B0A0JmiDsKMUvFCDTupu4v3kZ")
if err != nil {
t.Error(err)
}

Loading…
Cancel
Save