feat: change mobile field to username

This commit is contained in:
RockYang 2024-01-08 17:34:09 +08:00
parent 913d538587
commit 4c1f51110b
6 changed files with 12 additions and 6 deletions

View File

@ -199,13 +199,17 @@ func (h *PaymentHandler) PayQrcode(c *gin.Context) {
}
var payWay string
var notifyURL string
switch data.PayWay {
case "hupi":
payWay = PayWayXunHu
notifyURL = h.App.Config.HuPiPayConfig.NotifyURL
case "payjs":
payWay = PayWayJs
notifyURL = h.App.Config.JPayConfig.NotifyURL
default:
payWay = PayWayAlipay
notifyURL = h.App.Config.AlipayConfig.NotifyURL
}
// 创建订单
remark := types.OrderRemark{
@ -218,7 +222,7 @@ func (h *PaymentHandler) PayQrcode(c *gin.Context) {
}
order := model.Order{
UserId: user.Id,
Mobile: user.Username,
Username: user.Username,
ProductId: product.Id,
OrderNo: orderNo,
Subject: product.Name,
@ -267,7 +271,7 @@ func (h *PaymentHandler) PayQrcode(c *gin.Context) {
return
}
parse, err := url.Parse(h.App.Config.AlipayConfig.NotifyURL)
parse, err := url.Parse(notifyURL)
if err != nil {
resp.ERROR(c, err.Error())
return

View File

@ -10,7 +10,7 @@ type Order struct {
BaseModel
UserId uint
ProductId uint
Mobile string
Username string
OrderNo string
Subject string
Amount float64

View File

@ -8,7 +8,7 @@ type Order struct {
BaseVo
UserId uint `json:"user_id"`
ProductId uint `json:"product_id"`
Mobile string `json:"mobile"`
Username string `json:"username"`
OrderNo string `json:"order_no"`
Subject string `json:"subject"`
Amount float64 `json:"amount"`

View File

@ -0,0 +1,2 @@
ALTER TABLE `chatgpt_orders` CHANGE `mobile` `username` VARCHAR(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户明';
ALTER TABLE `chatgpt_invite_logs` CHANGE `username` `username` VARCHAR(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '用户名';

View File

@ -12,7 +12,7 @@
<el-table-column label="邀请奖励">
<template #default="scope">
<span>对话{{ scope.row['reward']['chat_calls'] }}</span>
<span>绘图{{ scope.row['reward']['chat_calls'] }}</span>
<span>绘图{{ scope.row['reward']['img_calls'] }}</span>
</template>
</el-table-column>

View File

@ -17,7 +17,7 @@
<el-row>
<el-table :data="items" :row-key="row => row.id" table-layout="auto">
<el-table-column prop="order_no" label="订单号"/>
<el-table-column prop="mobile" label="下单用户"/>
<el-table-column prop="username" label="下单用户"/>
<el-table-column prop="subject" label="产品名称"/>
<el-table-column prop="amount" label="订单金额"/>
<el-table-column label="调用次数">