Merge remote-tracking branch 'origin/mark' into yonghui
This commit is contained in:
@@ -179,6 +179,7 @@ func GetStoreOrderAfterTime(db *DaoDB, storeID int, orderTime time.Time, lastOrd
|
||||
FROM goods_order t1
|
||||
LEFT JOIN waybill t2 ON t1.vendor_waybill_id = t2.vendor_waybill_id AND t1.waybill_vendor_id = t2.waybill_vendor_id
|
||||
WHERE IF(t1.jx_store_id <> 0, t1.jx_store_id, t1.store_id) = ? AND t1.order_created_at >= ? AND t1.id > ? AND t1.status < ?
|
||||
AND (t1.flag & ?) = 0
|
||||
ORDER BY t1.order_created_at DESC, t1.id DESC;
|
||||
`
|
||||
sqlParams := []interface{}{
|
||||
@@ -186,6 +187,7 @@ func GetStoreOrderAfterTime(db *DaoDB, storeID int, orderTime time.Time, lastOrd
|
||||
orderTime,
|
||||
lastOrderSeqID,
|
||||
model.OrderStatusEndBegin,
|
||||
model.OrderFlagMaskFake,
|
||||
}
|
||||
return orderList, GetRows(db, &orderList, sql, sqlParams...)
|
||||
}
|
||||
@@ -899,7 +901,7 @@ func GetOrders(db *DaoDB, ids []int64, isIncludeSku, isIncludeFake bool, fromDat
|
||||
ORDER BY IF(t1.status < ?, IF(t1.vendor_id = ?, 0, 1), 0), t1.order_created_at DESC`
|
||||
sqlParams = append(sqlParams, model.OrderStatusEndBegin, model.VendorIDJX)
|
||||
} else {
|
||||
if isIncludeSku {
|
||||
if isIncludeSku && userID == "" {
|
||||
sql += `
|
||||
ORDER BY t1.id`
|
||||
} else {
|
||||
|
||||
@@ -206,7 +206,6 @@ func GetDirtyStoreCategories(db *DaoDB, vendorID, storeID int, level int) (cats
|
||||
}
|
||||
|
||||
// 以store_sku_bind为基础来做同步,正常情况下使用
|
||||
// !!! 此函数不要将store_sku_bind中的vendor_price取出来放到StoreSkuSyncInfo.VendorPrice中,因为之后会依赖这个VendorPrice进行重算
|
||||
// 单多门店模式厂商通用
|
||||
func GetStoreSkus2(db *DaoDB, vendorID, storeID int, skuIDs []int, mustDirty bool) (skus []*StoreSkuSyncInfo, err error) {
|
||||
if vendorID < 0 {
|
||||
|
||||
@@ -157,24 +157,6 @@ func (*SkuCategory) TableIndex() [][]string {
|
||||
}
|
||||
}
|
||||
|
||||
type SkuCategoryMap struct {
|
||||
ModelIDCULD
|
||||
|
||||
CatID int `orm:"column(cat_id)" json:"catID"`
|
||||
VendorID int `orm:"column(vendor_id)" json:"vendorID"`
|
||||
VendorOrgCode string `orm:"size(32)" json:"vendorOrgCode"` // 同一平台下不同的商户代码,如果只有一个,可以为空
|
||||
|
||||
VendorCatID string `orm:"size(32);column(vendor_cat_id)" json:"vendorCatID"`
|
||||
SyncStatus int8 `orm:"default(2)"`
|
||||
}
|
||||
|
||||
func (*SkuCategoryMap) TableUnique() [][]string {
|
||||
return [][]string{
|
||||
[]string{"CatID", "VendorID", "VendorOrgCode", "DeletedAt"},
|
||||
[]string{"VendorCatID", "VendorID", "VendorOrgCode", "DeletedAt"},
|
||||
}
|
||||
}
|
||||
|
||||
type SkuName struct {
|
||||
ModelIDCULD
|
||||
|
||||
|
||||
26
business/model/sync_map.go
Normal file
26
business/model/sync_map.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package model
|
||||
|
||||
const (
|
||||
ThingTypeCategory = 1
|
||||
ThingTypeSkuName = 2
|
||||
ThingTypeSku = 3
|
||||
)
|
||||
|
||||
type ThingMap struct {
|
||||
ModelIDCULD
|
||||
|
||||
ThingID int64 `orm:"column(thing_id)" json:"thingID"`
|
||||
ThingType int8 `json:"thingType"`
|
||||
VendorID int `orm:"column(vendor_id)" json:"vendorID"`
|
||||
VendorOrgCode string `orm:"size(32)" json:"vendorOrgCode"` // 同一平台下不同的商户代码,如果只有一个,可以为空
|
||||
|
||||
VendorThingID string `orm:"size(32);column(vendor_thing_id)" json:"vendorThingID"`
|
||||
SyncStatus int8 `orm:"default(2)"`
|
||||
}
|
||||
|
||||
func (*ThingMap) TableUnique() [][]string {
|
||||
return [][]string{
|
||||
[]string{"ThingID", "ThingType", "VendorID", "VendorOrgCode", "DeletedAt"},
|
||||
[]string{"VendorThingID", "ThingType", "VendorID", "VendorOrgCode", "DeletedAt"},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user