mirror of
				https://github.com/kongyuebin1/dongfeng-pay.git
				synced 2025-10-31 10:37:32 +08:00 
			
		
		
		
	修改传奇充值商户的账户显示
This commit is contained in:
		| @@ -1,39 +0,0 @@ | ||||
| package fast | ||||
|  | ||||
| import ( | ||||
| 	"github.com/astaxie/beego/logs" | ||||
| 	"github.com/beego/beego/v2/client/orm" | ||||
| ) | ||||
|  | ||||
| type RpAccount struct { | ||||
| 	Id            string `orm:"pk;column(id)"` | ||||
| 	CreateTime    string | ||||
| 	EditTime      string | ||||
| 	Version       int | ||||
| 	Remark        string | ||||
| 	AccountNo     string | ||||
| 	Balance       float64 | ||||
| 	Unbalance     float64 | ||||
| 	SecurityMoney float64 | ||||
| 	Status        string | ||||
| 	TotalIncome   float64 | ||||
| 	TodayIncome   float64 | ||||
| 	SettAmount    float64 | ||||
| 	UserNo        string | ||||
| 	AmountFrozen  float64 | ||||
| } | ||||
|  | ||||
| func (c *RpAccount) TableName() string { | ||||
| 	return "rp_account" | ||||
| } | ||||
|  | ||||
| func GetAccontInfo(userNo string) *RpAccount { | ||||
| 	o := orm.NewOrm() | ||||
|  | ||||
| 	rpAccount := new(RpAccount) | ||||
| 	if _, err := o.QueryTable("rp_account").Filter("user_no", userNo).All(rpAccount); err != nil { | ||||
| 		logs.Error("获取account信息失败:", err) | ||||
| 	} | ||||
|  | ||||
| 	return rpAccount | ||||
| } | ||||
| @@ -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 | ||||
| } | ||||
							
								
								
									
										38
									
								
								legend/models/fast/accountInfoDao.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								legend/models/fast/accountInfoDao.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,38 @@ | ||||
| package fast | ||||
|  | ||||
| import ( | ||||
| 	"github.com/astaxie/beego/logs" | ||||
| 	"github.com/beego/beego/v2/client/orm" | ||||
| ) | ||||
|  | ||||
| type AccountInfo struct { | ||||
| 	Id           string `orm:"pk;column(id)"` | ||||
| 	Status       string | ||||
| 	AccountUid   string | ||||
| 	AccountName  string | ||||
| 	Balance      float64 | ||||
| 	SettleAmount float64 | ||||
| 	LoanAmount   float64 | ||||
| 	WaitAmount   float64 | ||||
| 	FreezeAmount float64 | ||||
| 	PayforAmount float64 | ||||
| 	UpdateTime   string | ||||
| 	CreateTime   string | ||||
| } | ||||
|  | ||||
| const ACCOUNTINFO = "account_info" | ||||
|  | ||||
| func (c *AccountInfo) TableName() string { | ||||
| 	return "account_info" | ||||
| } | ||||
|  | ||||
| func GetAccountInfo(accountUid string) *AccountInfo { | ||||
| 	o := orm.NewOrm() | ||||
|  | ||||
| 	account := new(AccountInfo) | ||||
| 	if _, err := o.QueryTable(ACCOUNTINFO).Filter("account_uid", accountUid).All(account); err != nil { | ||||
| 		logs.Error("获取account信息失败:", err) | ||||
| 	} | ||||
|  | ||||
| 	return account | ||||
| } | ||||
							
								
								
									
										38
									
								
								legend/models/fast/orderInfoDao.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								legend/models/fast/orderInfoDao.go
									
									
									
									
									
										Normal file
									
								
							| @@ -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 | ||||
| } | ||||
							
								
								
									
										67
									
								
								legend/models/fast/userInfoDao.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										67
									
								
								legend/models/fast/userInfoDao.go
									
									
									
									
									
										Normal file
									
								
							| @@ -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 | ||||
| } | ||||
| @@ -42,10 +42,10 @@ func initFastPay() { | ||||
| 	orm.SetMaxIdleConns("default", 30) | ||||
| 	orm.SetMaxIdleConns("default", 30) | ||||
|  | ||||
| 	orm.RegisterModel(new(fast.RpUserInfo)) | ||||
| 	orm.RegisterModel(new(fast.MerchantInfo)) | ||||
| 	orm.RegisterModel(new(fast.RpUserPayConfig)) | ||||
| 	orm.RegisterModel(new(fast.RpUserBankAccount)) | ||||
| 	orm.RegisterModel(new(fast.RpAccount)) | ||||
| 	orm.RegisterModel(new(fast.AccountInfo)) | ||||
|  | ||||
| 	logs.Info("init fast success ......") | ||||
| } | ||||
| @@ -72,7 +72,15 @@ func initLegend() { | ||||
| 		os.Exit(1) | ||||
| 	} | ||||
|  | ||||
| 	orm.SetMaxIdleConns("default", 30) | ||||
| 	orm.SetMaxIdleConns("default", 30) | ||||
|  | ||||
| 	orm.RegisterModel(new(fast.MerchantInfo)) | ||||
| 	orm.RegisterModel(new(fast.RpUserPayConfig)) | ||||
| 	orm.RegisterModel(new(fast.RpUserBankAccount)) | ||||
| 	orm.RegisterModel(new(fast.AccountInfo)) | ||||
| 	orm.RegisterModel(new(fast.OrderInfo)) | ||||
|  | ||||
| 	logs.Info("init legend success ......") | ||||
|  | ||||
| 	orm.RegisterModel() | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user