package model import "time" const ( PayTypeWX = 1 // 微信支付 PayTypeTL = 2 // 通联宝支付 PayStatusNo = 0 PayStatusYes = 1 PayStatusFailed = 2 PayStatusCanceled = 3 PayStatusRefund = 4 RefundStatusNo = 0 RefundStatusYes = 1 RefundStatusFailed = 2 VendorPayTypeCompanyPay = "companyPay" //企业付款 VendorPayTypeTransferAccount = "transferAccount" //手动转账 ) const ( OrderTypeAddressErr = -1 //地址异常订单 OrderTypeNormal = 0 //普通订单 OrderTypeMatter = 1 //物料订单 OrderTypeSupplyGoods = 2 //进货订单 OrderTypeDefendPrice = 3 //守价订单 OrderTypePay = 1 //支付 OrderTypeCash = 2 //提现 ) var ( PayStatusName = map[int]string{ PayStatusNo: "待支付", PayStatusYes: "已支付", PayStatusFailed: "支付失败", PayStatusCanceled: "支付取消", PayStatusRefund: "已退款", } RefundStatusName = map[int]string{ RefundStatusNo: "待退款", RefundStatusYes: "已退款", RefundStatusFailed: "退款失败", } ) 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"` //订单类型 Way string `json:"way"` //weixinapp ,weixinmini Status int `json:"status"` //订单状态,待支付2,已支付5,支付成功110,支付失败115 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"` Address string `orm:"size(255)" json:"address"` } 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代表不通过 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"}, } }