temporay up

This commit is contained in:
苏尹岚
2020-02-07 11:46:35 +08:00
parent 96f2734c19
commit 8c602871e8
10 changed files with 346 additions and 1 deletions

View File

@@ -63,6 +63,11 @@ type tGoodsAndOrder struct {
PromotionType int `json:"promotionType"` // todo 当前是用于记录京东的PromotionType(生成jxorder用),没有做转换
}
type GoodsOrderPay struct {
model.GoodsOrder
TransactionID string `orm:"column(transaction_id)" json:"transactionID"`
}
//actID指结算活动的id
func QueryOrders(db *DaoDB, vendorOrderID string, actID int, vendorIDs []int, storeID int, fromDate, toDate time.Time) (orderList []*model.GoodsOrder, err error) {
sqlParams := []interface{}{}
@@ -1187,3 +1192,25 @@ func GetJxOrderCount(db *DaoDB, storeID int, orderID string, date time.Time) (co
err = GetRow(db, &count, sql, sqlParams...)
return count, err
}
func GetOrdersForJxPay(db *DaoDB, finishTimeBegin, finishTimeEnd time.Time) (goods []*GoodsOrderPay, err error) {
sql := `
SELECT a.*,b.transaction_id
FROM goods_order a
JOIN order_pay b ON a.vendor_order_id = b.vendor_order_id AND a.vendor_id = b.vendor_id
JOIN user c ON c.user_id = a.user_id
WHERE a.vendor_id = ?
AND a.order_finished_at >= ?
AND a.order_finished_at <= ?
AND a.status = ?
AND c.parent_mobile <> ''
`
sqlParams := []interface{}{
model.VendorIDJX,
finishTimeBegin,
finishTimeEnd,
model.OrderStatusFinished,
}
err = GetRows(db, &goods, sql, sqlParams...)
return goods, err
}

View File

@@ -472,6 +472,7 @@ type PriceReferSnapshot struct {
MaxVendorPrice int `json:"maxVendorPrice"`
MinVendorPrice int `json:"minVendorPrice"`
AvgVendorPrice int `json:"avgVendorPrice"`
JdDirectPrice int `json:"jdDirectPrice"`
}
func (*PriceReferSnapshot) TableUnique() [][]string {

View File

@@ -49,6 +49,10 @@ type User struct {
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"`
ParentMobile string `orm:"size(32)" json:"parentMobile"`
DividePercentage int `json:"dividePercentage"`
IsReceiver int `json:"isReceiver"`
}
func (*User) TableUnique() [][]string {