修改传奇充值商户的账户显示
parent
5ee1450a21
commit
c48d2f3e2c
@ -1,4 +1,4 @@
|
|||||||
package common
|
package common
|
||||||
|
|
||||||
const ACTIVE = "ACTIVE"
|
const ACTIVE = "active"
|
||||||
const UNACTIVE = "UNACTIVE"
|
const UNACTIVE = "unactive"
|
||||||
|
@ -1,58 +0,0 @@
|
|||||||
package fast
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/astaxie/beego/logs"
|
|
||||||
"github.com/beego/beego/v2/client/orm"
|
|
||||||
)
|
|
||||||
|
|
||||||
type RpUserInfo struct {
|
|
||||||
Id string `orm:"pk;column(id)"`
|
|
||||||
CreateTime string
|
|
||||||
Status string
|
|
||||||
UserNo string
|
|
||||||
UserName string
|
|
||||||
AccountNo string
|
|
||||||
Mobile string
|
|
||||||
Password string
|
|
||||||
PayPwd string
|
|
||||||
LastSmsVerifyCodeTime string
|
|
||||||
Email string
|
|
||||||
Ips string
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *RpUserInfo) TableName() string {
|
|
||||||
return "rp_user_info"
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
func tableName() string {
|
|
||||||
return "rp_user_info"
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetUserInfoByUserName(userName string) *RpUserInfo {
|
|
||||||
|
|
||||||
o := orm.NewOrm()
|
|
||||||
userInfo := new(RpUserInfo)
|
|
||||||
|
|
||||||
_, err := o.QueryTable(tableName()).Filter("mobile", userName).All(userInfo)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
logs.Error("根据用户名从数据获取用户信息失败:", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return userInfo
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
** 更新用户信息
|
|
||||||
*/
|
|
||||||
func UpdateUserInfo(userInfo *RpUserInfo) bool {
|
|
||||||
o := orm.NewOrm()
|
|
||||||
|
|
||||||
if _, err := o.Update(userInfo); err != nil {
|
|
||||||
logs.Error("更新用户信息失败,错误:%s", err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
|
@ -0,0 +1,38 @@
|
|||||||
|
package fast
|
||||||
|
|
||||||
|
type OrderInfo struct {
|
||||||
|
Id string `orm:"pk;column(id)"`
|
||||||
|
MerchantOrderId string
|
||||||
|
ShopName string
|
||||||
|
OrderPeriod string
|
||||||
|
BankOrderId string
|
||||||
|
BankTransId string
|
||||||
|
OrderAmount float64
|
||||||
|
ShowAmount float64
|
||||||
|
FactAmount float64
|
||||||
|
RollPoolCode string
|
||||||
|
RollPoolName string
|
||||||
|
RoadUid string
|
||||||
|
RoadName string
|
||||||
|
PayProductCode string
|
||||||
|
PayProductName string
|
||||||
|
PayTypeCode string
|
||||||
|
PayTypeName string
|
||||||
|
OsType string
|
||||||
|
Status string
|
||||||
|
Refund string
|
||||||
|
RefundTime string
|
||||||
|
Freeze string
|
||||||
|
FreezeTime string
|
||||||
|
Unfreeze string
|
||||||
|
UnfreezeTime string
|
||||||
|
ReturnUrl string
|
||||||
|
NotifyUrl string
|
||||||
|
MerchantUid string
|
||||||
|
MerchantName string
|
||||||
|
AgentUid string
|
||||||
|
AgentName string
|
||||||
|
Response string
|
||||||
|
UpdateTime string
|
||||||
|
CreateTime string
|
||||||
|
}
|
@ -0,0 +1,67 @@
|
|||||||
|
package fast
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/astaxie/beego/logs"
|
||||||
|
"github.com/beego/beego/v2/client/orm"
|
||||||
|
)
|
||||||
|
|
||||||
|
type MerchantInfo struct {
|
||||||
|
Id string `orm:"pk;column(id)"`
|
||||||
|
Status string
|
||||||
|
BelongAgentUid string
|
||||||
|
BelongAgentName string
|
||||||
|
MerchantName string
|
||||||
|
MerchantUid string
|
||||||
|
MerchantKey string
|
||||||
|
MerchantSecret string
|
||||||
|
LoginAccount string
|
||||||
|
LoginPassword string
|
||||||
|
AutoSettle string
|
||||||
|
AutoPayFor string
|
||||||
|
WhiteIps string
|
||||||
|
Remark string
|
||||||
|
SinglePayForRoadUid string
|
||||||
|
SinglePayForRoadName string
|
||||||
|
RollPayForRoadCode string
|
||||||
|
RollPayForRoadName string
|
||||||
|
PayforFee string
|
||||||
|
CreateTime string
|
||||||
|
UpdateTime string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *MerchantInfo) TableName() string {
|
||||||
|
return "merchant_info"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func tableName() string {
|
||||||
|
return "merchant_info"
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetMerchantInfoByUserName(userName string) *MerchantInfo {
|
||||||
|
|
||||||
|
o := orm.NewOrm()
|
||||||
|
userInfo := new(MerchantInfo)
|
||||||
|
|
||||||
|
_, err := o.QueryTable(tableName()).Filter("login_account", userName).All(userInfo)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
logs.Error("根据用户名从数据获取用户信息失败:", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return userInfo
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
** 更新用户信息
|
||||||
|
*/
|
||||||
|
func UpdateMerchantInfo(merchantInfo *MerchantInfo) bool {
|
||||||
|
o := orm.NewOrm()
|
||||||
|
|
||||||
|
if _, err := o.Update(merchantInfo); err != nil {
|
||||||
|
logs.Error("更新用户信息失败,错误:%s", err)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
@ -1,15 +1,18 @@
|
|||||||
package service
|
package service
|
||||||
|
|
||||||
import "legend/models/fast"
|
import (
|
||||||
|
"legend/models/fast"
|
||||||
|
)
|
||||||
|
|
||||||
type AccountService struct {
|
type AccountService struct {
|
||||||
BaseService
|
BaseService
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *AccountService) GetAccountInfo(userName string) *fast.RpAccount {
|
func (c *AccountService) GetAccountInfo(userName string) *fast.AccountInfo {
|
||||||
userInfo := fast.GetUserInfoByUserName(userName)
|
|
||||||
|
|
||||||
accountInfo := fast.GetAccontInfo(userInfo.UserNo)
|
merchantInfo := fast.GetMerchantInfoByUserName(userName)
|
||||||
|
|
||||||
|
accountInfo := fast.GetAccountInfo(merchantInfo.MerchantUid)
|
||||||
|
|
||||||
return accountInfo
|
return accountInfo
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue