天假支付宝提现操作

This commit is contained in:
邹宗楠
2022-07-06 16:49:15 +08:00
parent 6c26e35a23
commit 289ced8fbb
6 changed files with 64 additions and 9 deletions

View File

@@ -129,3 +129,9 @@ func GetUserBillDetail(db *DaoDB, userID string, fromTime, toTime time.Time, pag
}
return pagedInfo, err
}
// UpdateUserBill 修改用户余额
func UpdateUserBill(userId string, money int) error {
_, err := ExecuteSQL(GetDB(), `UPDATE user_bill SET account_balance = ? WHERE user_id = ? `, []interface{}{money, userId}...)
return err
}

View File

@@ -123,7 +123,7 @@ func GetUsers2(db *DaoDB, keyword string, userID string, pop int, mobile string,
sqlParams := []interface{}{}
sql := `
SELECT SQL_CALC_FOUND_ROWS DISTINCT
a.*
a.*,ub.account_balance
FROM user a`
for _, v := range consumeTypes {
switch v {
@@ -171,6 +171,7 @@ func GetUsers2(db *DaoDB, keyword string, userID string, pop int, mobile string,
}
}
}
sql += ` JOIN user_bill ub ON ub.user_id = a.user_id`
sql += `
WHERE a.status = 1 AND a.deleted_at = ?`
sqlParams = append(sqlParams, utils.DefaultTimeValue)

View File

@@ -54,14 +54,15 @@ type User struct {
IDCardNo string `orm:"size(18);column(id_card_no)" json:"idCardNo" compact:"idCardNo"` // 身份证号
Remark string `orm:"size(255)" json:"remark"`
LastLoginAt *time.Time `orm:"null" json:"lastLoginAt"`
LastLoginIP string `orm:"size(64);column(last_login_ip)" json:"lastLoginIP"`
LastLoginType string `orm:"size(16)" json:"lastLoginType"`
PopCode string `json:"popCode"` //推广码
PopUser string `json:"popUser"` //推广人
PopCount int `json:"popCount"` //推荐人数
PopFlag int `json:"popFlag"` //是否已通过推荐获得免费会员
PopedFlag int `json:"popedFlag"` //被邀请标志(弹框)
LastLoginAt *time.Time `orm:"null" json:"lastLoginAt"`
LastLoginIP string `orm:"size(64);column(last_login_ip)" json:"lastLoginIP"`
LastLoginType string `orm:"size(16)" json:"lastLoginType"`
PopCode string `json:"popCode"` //推广码
PopUser string `json:"popUser"` //推广人
PopCount int `json:"popCount"` //推荐人数
PopFlag int `json:"popFlag"` //是否已通过推荐获得免费会员
PopedFlag int `json:"popedFlag"` //被邀请标志(弹框)
AccountBalance int64 `json:"-"` // 银行余额
}
func (*User) TableUnique() [][]string {