修复注册赠送bug

pull/361/head
HXY 2 years ago
parent d999cdf3e5
commit dd09baa75a

@ -80,7 +80,7 @@ func (s *userManageSrv) UpdateUser(user *ms.User) error {
//获取用户的账单,判断是否赠送过
bills, err := (&dbr.WalletStatement{}).List(tx, &dbr.ConditionsT{
"user_id = ?": user.ID,
"reason = ?": "手机号绑定赠送",
"reason = ?": "注册赠送",
}, 0, 1)
if err != nil {
return err
@ -103,7 +103,8 @@ func (s *userManageSrv) UpdateUser(user *ms.User) error {
//获取当前时间戳并加上14天
user.Balance = time.Now().Unix() + 1209600
} else {
user.Balance = oldUser.Balance + user.Balance
//更新当前用户的balance时间戳增加14天
user.Balance = oldUser.Balance + 1209600
}
err = user.Update(s.db)
@ -116,7 +117,7 @@ func (s *userManageSrv) UpdateUser(user *ms.User) error {
UserID: user.ID,
ChangeAmount: 1400,
BalanceSnapshot: user.Balance,
Reason: "手机号绑定赠送",
Reason: "注册赠送",
}).Error; err != nil {
return err
}

@ -97,7 +97,7 @@ func (s *alipayPrivSrv) UserRechargeLink(req *web.UserRechargeLinkReq) (*web.Use
p.TotalAmount = fmt.Sprintf("%.2f", float64(recharge.Amount)/100.0*a)
p.NotifyURL = "https://" + req.Host + "/v1/alipay/notify"
//支付宝回调,如果是内网环境的话,需要增加内网穿透
//p.NotifyURL = "http://uszkjc.natappfree.cc/v1/alipay/notify"
//p.NotifyURL = "http://bgqsmb.natappfree.cc/v1/alipay/notify"
rsp, err := s.alipayClient.TradePreCreate(p)
if err != nil {
logrus.Errorf("client.TradePreCreate err: %v\n", err)

@ -20,7 +20,7 @@
:options="optionsRef"
@search="handleSearch"
@update:value="changeContent"
placeholder="讲讲今天和AI聊的工具吧"
placeholder="讲讲今天和AiMo AI聊天的新发现吧"
/>
</div>
@ -147,7 +147,7 @@
</template>
</n-button>
<n-button
<!-- <n-button
v-if="allowTweetVisibility"
quaternary
circle
@ -159,7 +159,7 @@
<eye-outline />
</n-icon>
</template>
</n-button>
</n-button> -->
</div>
<div class="submit-wrap">

@ -5,7 +5,7 @@ const routes = [
path: '/',
name: 'home',
meta: {
title: '广场',
title: '发现',
keepAlive: true,
},
component: () => import('@/views/Home.vue'),

@ -336,17 +336,17 @@ const userOptions = computed(() => {
});
}
}
if (user.is_friend) {
options.push({
label: '',
key: 'delete',
});
} else {
options.push({
label: '',
key: 'requesting',
});
}
// if (user.is_friend) {
// options.push({
// label: '删除好友',
// key: 'delete',
// });
// } else {
// options.push({
// label: '添加朋友',
// key: 'requesting',
// });
// }
return options;
});
const handleUserAction = (

@ -6,7 +6,7 @@
<div class="balance-wrap">
<div class="balance-line">
<!-- () -->
<n-statistic label="会员有效期 (天)"
<n-statistic label="订阅有效期 (天)"
><n-number-animation
:from="0.0"
:to="timecal(store.state.userInfo.balance) || 0 "

Loading…
Cancel
Save