修改传奇充值商户的账户显示

This commit is contained in:
kongyuebin
2021-04-30 15:55:02 +08:00
parent 5ee1450a21
commit c48d2f3e2c
15 changed files with 197 additions and 227 deletions

View File

@@ -18,9 +18,9 @@ func (c *BasicController) Prepare() {
userName, ok := c.GetSession("userName").(string)
if ok {
logs.Info("该用户已经登录, userName", userName)
userInfo := fast.GetUserInfoByUserName(userName)
if userInfo.Mobile != "" {
c.Data["nickName"] = userInfo.UserName
userInfo := fast.GetMerchantInfoByUserName(userName)
if userInfo.LoginAccount != "" {
c.Data["nickName"] = userInfo.MerchantName
}
} else {
c.Data["nickName"] = "史蒂芬-库里"

View File

@@ -1,6 +1,8 @@
package controllers
import (
"fmt"
"github.com/beego/beego/v2/core/logs"
"legend/controllers/base"
"legend/service"
"legend/utils"
@@ -21,13 +23,18 @@ func (c *ShowPageController) WelcomePage() {
userName := c.GetSession("userName").(string)
fmt.Println(userName)
accountService := new(service.AccountService)
accountInfo := accountService.GetAccountInfo(userName)
logs.Debug("account信息", accountInfo)
c.Data["balance"] = accountInfo.Balance
c.Data["unBalance"] = accountInfo.Unbalance
c.Data["settleAmount"] = accountInfo.SettAmount
c.Data["todayAmount"] = accountInfo.TodayIncome
c.Data["unBalance"] = accountInfo.FreezeAmount
c.Data["settleAmount"] = accountInfo.SettleAmount
//c.Data["todayAmount"] = accountInfo.TodayIncome
// 获取今天充值金额
c.TplName = "welcome.html"
}
@@ -136,7 +143,7 @@ func (c *ShowPageController) PersonPage() {
} else {
merchantService := new(service.MerchantService)
userInfo := merchantService.MerchantInfo(userName)
c.Data["userName"] = userInfo.UserName
c.Data["userName"] = userInfo.MerchantName
}
c.TplName = "person.html"