精简商户后台的代码

This commit is contained in:
kongyuebin
2021-11-12 22:45:37 +08:00
parent 0bb777213b
commit 70d441beb7
9 changed files with 23 additions and 170 deletions

View File

@@ -83,6 +83,6 @@ func (c *History) HistoryQueryAndListPage() {
out["root"] = list // 显示数据
c.Data["json"] = out
c.ServeJSON()
_ = c.ServeJSON()
c.StopRun()
}

View File

@@ -30,7 +30,7 @@ func (c *DealExcel) DownloadExcelModel() {
ranMd5 := encrypt.EncodeMd5([]byte(pubMethod.RandomString(46)))
c.Ctx.SetCookie(enum.UserCookie, ranMd5, enum.CookieExpireTime)
c.Ctx.SetSecureCookie(ranMd5, enum.UserCookie, ranMd5, enum.CookieExpireTime)
c.SetSession(enum.UserCookie, ranMd5)
_ = c.SetSession(enum.UserCookie, ranMd5)
c.Ctx.Output.Download(enum.ExcelModelPath, enum.ExcelModelName)
}
@@ -152,7 +152,7 @@ func (c *DealExcel) MakeOrderExcel() {
stopRun:
c.Data["json"] = pubMethod.JsonFormat(flag, "", msg, "")
c.ServeJSON()
_ = c.ServeJSON()
c.StopRun()
}
@@ -163,7 +163,7 @@ func (c *DealExcel) DownloadRecordExcel() {
defer func() {
if r := recover(); r != nil {
logs.Error(fmt.Sprintf("%s此文件不存在",file))
logs.Error(fmt.Sprintf("%s此文件不存在", file))
time.Sleep(3 * time.Second)
}
}()

View File

@@ -13,7 +13,7 @@ import (
"fmt"
"github.com/rs/xid"
"github.com/tealeg/xlsx"
"merchant/common"
"merchant/conf"
"merchant/models"
"merchant/sys/enum"
"merchant/utils"
@@ -273,18 +273,18 @@ func handleFileContent(name string, u models.MerchantInfo, c *Withdraw) (bool, s
PhoneNo: u.LoginAccount,
MerchantOrderId: xid.New().String(),
BankOrderId: "4444" + xid.New().String(),
PayforFee: common.PAYFOR_FEE,
Type: common.SELF_MERCHANT,
PayforFee: conf.PAYFOR_FEE,
Type: conf.SELF_MERCHANT,
PayforAmount: money,
PayforTotalAmount: money + common.PAYFOR_FEE,
PayforTotalAmount: money + conf.PAYFOR_FEE,
BankCode: "C",
BankName: row.Cells[2].String(),
IsSend: common.NO,
IsSend: conf.NO,
BankAccountName: row.Cells[0].String(),
BankAccountNo: row.Cells[1].String(),
BankAccountType: bankAccountType,
BankAccountAddress: row.Cells[2].String(),
Status: common.PAYFOR_COMFRIM,
Status: conf.PAYFOR_COMFRIM,
CreateTime: pubMethod.GetNowTime(),
UpdateTime: pubMethod.GetNowTime(),
}

View File

@@ -12,7 +12,7 @@ package controllers
import (
"fmt"
"github.com/rs/xid"
"merchant/common"
"merchant/conf"
"merchant/models"
"merchant/sys/enum"
"merchant/utils"
@@ -257,18 +257,18 @@ func (c *Withdraw) LaunchSingleWithdraw() {
PhoneNo: u.LoginAccount,
MerchantOrderId: xid.New().String(),
BankOrderId: "4444" + xid.New().String(),
PayforFee: common.PAYFOR_FEE,
Type: common.SELF_MERCHANT,
PayforFee: conf.PAYFOR_FEE,
Type: conf.SELF_MERCHANT,
PayforAmount: amount,
PayforTotalAmount: amount + common.PAYFOR_FEE,
PayforTotalAmount: amount + conf.PAYFOR_FEE,
BankCode: bankCode,
BankName: enum.GetBankInfo()[bankCode],
IsSend: common.NO,
IsSend: conf.NO,
BankAccountName: accountName,
BankAccountNo: cardNo,
BankAccountType: bankAccountType,
BankAccountAddress: province + city + bankAccountAddress,
Status: common.PAYFOR_COMFRIM,
Status: conf.PAYFOR_COMFRIM,
CreateTime: pubMethod.GetNowTime(),
UpdateTime: pubMethod.GetNowTime(),
}