192 lines
8.8 KiB
Go
192 lines
8.8 KiB
Go
package model
|
||
|
||
import "time"
|
||
|
||
const (
|
||
PayTypeWX = 1 // 微信支付
|
||
PayTypeTL = 2 // 通联宝支付
|
||
PayTypeAliPay = 3 // 支付包
|
||
|
||
PayStatusNo = 0
|
||
PayStatusYes = 1
|
||
PayStatusFailed = 2
|
||
PayStatusCanceled = 3
|
||
PayStatusRefund = 4
|
||
|
||
RefundStatusNo = 0
|
||
RefundStatusYes = 1
|
||
RefundStatusFailed = 2
|
||
|
||
VendorPayTypeCompanyPay = "companyPay" //企业付款
|
||
VendorPayTypeTransferAccount = "transferAccount" //手动转账
|
||
|
||
PayType4Member = 1 // 购买会员
|
||
PayType4Recharge = 2 // 充值余额
|
||
PayType4Express = 3 // 支付快递
|
||
)
|
||
|
||
const (
|
||
OrderTypePay = 1 //支付
|
||
OrderTypeCash = 2 //提现
|
||
|
||
OrderTypePublishJob = 1 //发布任务
|
||
OrderTypeMember = 2 //充值会员月卡
|
||
OrderTypeMemberYear = 5 //充值会员年卡
|
||
OrderTypeDelivery = 3 //发快递
|
||
OrderTypeDropShipping = 4 //一件代发交钱
|
||
)
|
||
|
||
var (
|
||
PayStatusName = map[int]string{
|
||
PayStatusNo: "待支付",
|
||
PayStatusYes: "已支付",
|
||
PayStatusFailed: "支付失败",
|
||
PayStatusCanceled: "支付取消",
|
||
PayStatusRefund: "已退款",
|
||
}
|
||
|
||
RefundStatusName = map[int]string{
|
||
RefundStatusNo: "待退款",
|
||
RefundStatusYes: "已退款",
|
||
RefundStatusFailed: "退款失败",
|
||
}
|
||
)
|
||
|
||
// 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"` // 支付还是提现 1-支付,2-提现
|
||
OrderType int `json:"orderType"` // 订单类型,1-发任务,2-会员月卡,3-发快递,4-提现,5-会员年卡
|
||
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-支付宝提现
|
||
}
|
||
|
||
func (v *Order) TableUnique() [][]string {
|
||
return [][]string{
|
||
[]string{"OrderID"},
|
||
}
|
||
}
|
||
|
||
func (v *Order) TableIndex() [][]string {
|
||
return [][]string{
|
||
[]string{"CreatedAt"},
|
||
[]string{"UserID"},
|
||
}
|
||
}
|
||
|
||
type DeliveryOrder struct {
|
||
ModelIDCUL
|
||
|
||
VendorWaybillID string `orm:"column(vendor_waybill_id)" json:"vendorWaybillID"` //运单号
|
||
UserID string `orm:"column(user_id);size(48)" json:"userID"` //用户ID
|
||
DeliverySendID int `orm:"column(delivery_send_id)" json:"deliverySendID"` //寄件人地址ID
|
||
SendName string `json:"sendName"`
|
||
SendMobile string `json:"sendMobile"`
|
||
SendAddress string `json:"sendAddress"`
|
||
SendDetailAddress string `json:"sendDetailAddress"`
|
||
SendLng float64 `json:"sendLng"`
|
||
SendLat float64 `json:"sendLat"`
|
||
SendAutoAddress string `json:"sendAutoAddress"`
|
||
SendCityCode int `json:"sendCityCode"`
|
||
SendDistrictCode int `json:"sendDistrictCode"`
|
||
DeliveryReceiveID int `orm:"column(delivery_receive_id)" json:"deliveryReceiveID"` //取件人地址ID(收货人)\
|
||
ReceiveName string `json:"receiveName"`
|
||
ReceiveMobile string `json:"receiveMobile"`
|
||
ReceiveAddress string `json:"receiveAddress"`
|
||
ReceiveDetailAddress string `json:"receiveDetailAddress"`
|
||
ReceiveLng float64 `json:"receiveLng"`
|
||
ReceiveLat float64 `json:"receiveLat"`
|
||
ReceiveAutoAddress string `json:"receiveAutoAddress"`
|
||
ReceiveCityCode int `json:"receiveCityCode"`
|
||
ReceiveDistrictCode int `json:"receiveDistrictCode"`
|
||
Status int `json:"status"` //运单状态
|
||
PayPrice int `json:"payPrice"` //支付金额
|
||
OrderFinishedAt time.Time `json:"orderFinishedAt"` //订单完成时间
|
||
Weight float64 `json:"weight"` //订单重量,单位kg
|
||
Vloumn float64 `json:"vloumn"` //订单体积,单位立方cm
|
||
Description string `json:"description"` //订单商品描述
|
||
PickUpStartTime time.Time `json:"pickUpStartTime"` //预约取件开始时间
|
||
PickUpEndTime time.Time `json:"pickUpEndTime"` //预约取件结束时间
|
||
PackageCount int `json:"packageCount"` //包裹数
|
||
ActualWeight float64 `json:"actualWeight"` //实际重量
|
||
IsWeight int `json:"isWeight"` //0代表未验重,1代表验重通过,2代表不通过
|
||
DiffPrice int `json:"diffPrice"` //如果超重了,扣除的差额
|
||
Comment string `orm:"size(255)" json:"comment"` //备注
|
||
JobOrderID string `orm:"column(job_order_id)" json:"jobOrderID"`
|
||
}
|
||
|
||
func (v *DeliveryOrder) TableUnique() [][]string {
|
||
return [][]string{
|
||
[]string{"VendorWaybillID"},
|
||
}
|
||
}
|
||
|
||
func (v *DeliveryOrder) TableIndex() [][]string {
|
||
return [][]string{
|
||
[]string{"CreatedAt"},
|
||
[]string{"UserID"},
|
||
}
|
||
}
|
||
|
||
//联盟订单
|
||
type UnionOrder struct {
|
||
ModelIDCUL
|
||
|
||
VendorOrderID string `orm:"column(vendor_order_id)" json:"vendorOrderID"` //订单号
|
||
VendorID int `orm:"column(vendor_id)" json:"vendorID"` //平台ID
|
||
UserID string `orm:"column(user_id);size(48)" json:"userID"` //用户ID
|
||
Status int `json:"status"` //订单状态
|
||
PayPrice int `json:"payPrice"` //支付金额
|
||
PromotionAmount int `json:"promotionAmount"` //佣金金额
|
||
GoodsName string `orm:"size(255)" json:"goodsName"` //商品名
|
||
GoodsID string `orm:"column(goods_id)" json:"goodsID"` //商品ID
|
||
GoodsImg string `json:"goodsImg"` //商品图
|
||
OrderCreateAt time.Time `json:"orderCreateAt"` //下单时间
|
||
OrderPayAt time.Time `json:"orderPayAt"` //支付时间
|
||
OrderReceiveAt time.Time `json:"orderReceiveAt"` //收货时间
|
||
OrderSettleAt time.Time `json:"orderSettleAt"` //结算时间
|
||
PID string `orm:"column(p_id)" json:"pID"` //推广位ID
|
||
IsEarning int `json:"isEarning"` //是否结算此订单,1表示已结算了
|
||
Comment string `orm:"size(255)" json:"comment"` //备注
|
||
}
|
||
|
||
func (v *UnionOrder) TableUnique() [][]string {
|
||
return [][]string{
|
||
[]string{"VendorOrderID", "VendorID"},
|
||
}
|
||
}
|
||
|
||
func (v *UnionOrder) TableIndex() [][]string {
|
||
return [][]string{
|
||
[]string{"OrderCreateAt"},
|
||
[]string{"UserID"},
|
||
}
|
||
}
|
||
|
||
//联盟订单轨迹
|
||
type UnionOrderStatus struct {
|
||
ModelIDCUL
|
||
|
||
VendorOrderID string `orm:"column(vendor_order_id)" json:"vendorOrderID"` //订单号
|
||
VendorID int `orm:"column(vendor_id)" json:"vendorID"` //平台ID
|
||
Status int `json:"status"` //订单状态
|
||
VendorStatus string `json:"vendorStatus"` //平台状态
|
||
OrderStatusAt time.Time `json:"orderStatusAt"` //更新时间
|
||
Comment string `orm:"size(255)" json:"comment"` //备注
|
||
}
|