- 修复GetEffectiveActStoreSkuInfo中没有获取vendor_id的bug
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
package jxutils
|
package jxutils
|
||||||
|
|
||||||
import "git.rosy.net.cn/jx-callback/business/model"
|
import (
|
||||||
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
|
)
|
||||||
|
|
||||||
type ActStoreSkuMap struct {
|
type ActStoreSkuMap struct {
|
||||||
actStoreSkuMap map[int64]map[int]*model.ActStoreSku2
|
actStoreSkuMap map[int64]map[int]*model.ActStoreSku2
|
||||||
|
|||||||
18
business/jxutils/jxutils_act_test.go
Normal file
18
business/jxutils/jxutils_act_test.go
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
package jxutils
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
|
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestGetActStoreSku(t *testing.T) {
|
||||||
|
actStoreSkuList, err := dao.GetEffectiveActStoreSkuInfo(dao.GetDB(), 0, []int{model.VendorIDMTWM}, []int{102046}, []int{25430, 30611},
|
||||||
|
utils.Str2Time("2019-07-27 13:29:57"), utils.Str2Time("2019-07-27 13:29:57"))
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
storeSkuMap := NewActStoreSkuMap(actStoreSkuList, false)
|
||||||
|
}
|
||||||
@@ -6,8 +6,13 @@ import (
|
|||||||
|
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
|
"git.rosy.net.cn/jx-callback/globals/testinit"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
testinit.Init()
|
||||||
|
}
|
||||||
|
|
||||||
func TestEarthDistance(t *testing.T) {
|
func TestEarthDistance(t *testing.T) {
|
||||||
lng1, lat1 := 118.796877, 32.060255
|
lng1, lat1 := 118.796877, 32.060255
|
||||||
lng2, lat2 := 116.407395, 39.904211
|
lng2, lat2 := 116.407395, 39.904211
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ func GetEffectiveActStoreSkuInfo(db *DaoDB, actID int, vendorIDs []int, storeIDs
|
|||||||
sql := `
|
sql := `
|
||||||
SELECT
|
SELECT
|
||||||
t2.*,
|
t2.*,
|
||||||
t3.actual_act_price, t3.sync_status, t3.vendor_price
|
t3.actual_act_price, t3.sync_status, t3.vendor_price, t3.vendor_id
|
||||||
FROM act t1
|
FROM act t1
|
||||||
JOIN act_store_sku t2 ON t2.act_id = t1.id AND t2.deleted_at = ?
|
JOIN act_store_sku t2 ON t2.act_id = t1.id AND t2.deleted_at = ?
|
||||||
JOIN act_store_sku_map t3 ON t3.bind_id = t2.id AND t3.act_id = t1.id
|
JOIN act_store_sku_map t3 ON t3.bind_id = t2.id AND t3.act_id = t1.id
|
||||||
|
|||||||
Reference in New Issue
Block a user