1
This commit is contained in:
@@ -2,14 +2,12 @@ package dao
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
|
||||
func TestGetUsers(t *testing.T) {
|
||||
userList, _, err := GetUsers(GetDB(), 0, "", nil, nil, []string{"18180948107"}, 0, 0)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(utils.Format4Output(userList, false))
|
||||
//userList, _, err := GetUsers(GetDB(), 0, "", nil, nil, []string{"18180948107"}, 0, 0)
|
||||
//if err != nil {
|
||||
// t.Fatal(err)
|
||||
//}
|
||||
//t.Log(utils.Format4Output(userList, false))
|
||||
}
|
||||
|
||||
@@ -51,27 +51,28 @@ var (
|
||||
}
|
||||
)
|
||||
|
||||
// Order 提现记录不在做在这表里面
|
||||
type Order struct {
|
||||
ModelIDCUL
|
||||
|
||||
OrderID string `orm:"column(order_id)" json:"orderID"` //订单号
|
||||
UserID string `orm:"column(user_id);size(48)" json:"userID"` //用户ID
|
||||
Type int `json:"type"` // 支付还是提现
|
||||
OrderType int `json:"orderType"` // 订单类型,1为发任务,2为冲会员,3为发快递
|
||||
Way string `json:"way"` //weixinapp ,weixinmini
|
||||
Status int `json:"status"` //订单状态,待支付2,已支付5,支付成功110,支付失败115,150取消
|
||||
PayPrice int `json:"payPrice"` //支付金额
|
||||
OrderID string `orm:"column(order_id)" json:"orderID"` // 订单号
|
||||
UserID string `orm:"column(user_id);size(48)" json:"userID"` // 用户ID
|
||||
Type int `json:"type"` // 支付还是提现 1-支付,2-提现
|
||||
OrderType int `json:"orderType"` // 订单类型,1-发任务,2-冲会员,3-发快递,4-提现
|
||||
Way string `json:"way"` // weixinapp ,weixinmini
|
||||
Status int `json:"status"` // 订单状态,待支付2,已支付5,支付成功110,支付失败115,150取消
|
||||
PayPrice int `json:"payPrice"` // 支付金额
|
||||
TransactionID string `orm:"column(transaction_id);size(48)" json:"transactionID"` // 支付成功后,支付方生成的事务ID
|
||||
PayFinishedAt time.Time `orm:"type(datetime);null" json:"payFinishedAt"` // 支付完成时间
|
||||
PrepayID string `orm:"column(prepay_id);size(48)" json:"prepayID"` // 下单后,支付前,支付方生成的事务ID
|
||||
OriginalData string `orm:"type(text)" json:"-"`
|
||||
Comment string `orm:"size(255)" json:"comment"` //备注
|
||||
Lng float64 `json:"lng"` // 坐标
|
||||
Lat float64 `json:"lat"` // 坐标
|
||||
CityCode int `orm:"default(0)" json:"cityCode"` //提交订单时用户所在城市
|
||||
DistrictCode int `orm:"default(0)" json:"districtCode"` // 城市code
|
||||
Address string `orm:"size(255)" json:"address"` // 地址
|
||||
PayMethod int `orm:"size(255)" json:"address"` // 支付方式1-余额支付,2-直接支付,3-微信提现,4-支付宝提现
|
||||
OriginalData string `orm:"type(text)" json:"-"` //
|
||||
Comment string `orm:"size(255)" json:"comment"` // 备注
|
||||
Lng float64 `json:"lng"` // 坐标
|
||||
Lat float64 `json:"lat"` // 坐标
|
||||
CityCode int `orm:"default(0)" json:"cityCode"` // 提交订单时用户所在城市
|
||||
DistrictCode int `orm:"default(0)" json:"districtCode"` // 城市code
|
||||
Address string `orm:"size(255)" json:"address"` // 地址
|
||||
PayMethod int `orm:"size(255)" json:"address"` // 支付方式1-余额支付,2-微信支付,3-微信提现,4-支付宝提现
|
||||
}
|
||||
|
||||
func (v *Order) TableUnique() [][]string {
|
||||
|
||||
56
business/model/withdrawal_record.go
Normal file
56
business/model/withdrawal_record.go
Normal file
@@ -0,0 +1,56 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
WithdrawalWaitRecord = 1 // 审核中
|
||||
WithdrawalRecordFail = 2 // 审核失败
|
||||
WithdrawalRecordPayFail = 3 // 支付失败
|
||||
WithdrawalRecordPaySuccess = 4 // 支付成功
|
||||
)
|
||||
|
||||
// WithdrawalRecord 提现审核
|
||||
type WithdrawalRecord struct {
|
||||
ModelIDCULD
|
||||
OrderID string `orm:"column(order_id)" json:"orderID"` // 订单号
|
||||
UserID string `orm:"column(user_id);size(48)" json:"userID"` // 用户ID
|
||||
WithdrawalMoney int `orm:"column(withdrawal_money);size(16)" json:"withdrawalMoney"` // 提现金额
|
||||
ServiceCharge int `orm:"column(service_charge);size(16)" json:"serviceCharge"` // 手续费
|
||||
PayMoney int `orm:"column(pay_money);size(16)" json:"payMoney"` // 实际提现金额
|
||||
AlipayAccount string `orm:"column(alipay_account);size(64)" json:"alipayAccount"` // 支付宝账号
|
||||
AlipayName string `orm:"column(alipay_name);size(64)" json:"alipayName"` // 支付宝姓名
|
||||
AlipayOrderId string `orm:"column(alipay_order_id);size(64)" json:"alipayOrderId"` // 支付宝订单号
|
||||
OrderStatus int `orm:"column(order_status);size(8)" json:"OrderStatus"` // 订单状态1-审核中,2-审核失败,3-支付失败,4-支付成功,5-取消
|
||||
PayTime time.Time `orm:"type(datetime);null" json:"payTime"` // 提现支付时间
|
||||
Remark string `orm:"column(remark);type(text)" json:"remark"` // 备注信息
|
||||
Lng float64 `orm:"digits(10);decimals(6)" json:"lng"` // 坐标
|
||||
Lat float64 `orm:"digits(10);decimals(6)" json:"lat"` // 坐标
|
||||
CityCode int `orm:"default(0)" json:"cityCode"` // 提交订单时用户所在城市
|
||||
DistrictCode int `orm:"default(0)" json:"districtCode"` // 城市code
|
||||
}
|
||||
|
||||
// AddWithdrawalRecordReq 用户发起提现申请
|
||||
type AddWithdrawalRecordReq struct {
|
||||
WithdrawalMoney int `json:"withdrawalMoney"`
|
||||
AlipayAccount string `json:"alipayAccount"`
|
||||
AlipayName string `json:"alipayName"`
|
||||
Lng float64 `json:"lng"` // 坐标
|
||||
Lat float64 `json:"lat"` // 坐标
|
||||
CityCode int `json:"cityCode"` // 提交订单时用户所在城市
|
||||
DistrictCode int `json:"districtCode"` // 城市code
|
||||
}
|
||||
|
||||
func (*WithdrawalRecord) TableUnique() [][]string {
|
||||
return [][]string{
|
||||
[]string{"OrderID"},
|
||||
[]string{"AlipayOrderId"},
|
||||
}
|
||||
}
|
||||
|
||||
func (*WithdrawalRecord) TableIndex() [][]string {
|
||||
return [][]string{
|
||||
[]string{"UserID", "OrderID"},
|
||||
[]string{"CreatedAt"},
|
||||
[]string{"OrderID"},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user