- 删除GetActVendorInfo,在QueryActs返回结果中包含平台相关信息`
This commit is contained in:
@@ -37,17 +37,6 @@ type ActDetail struct {
|
||||
model.Act2
|
||||
}
|
||||
|
||||
type ActMapPureInfo struct {
|
||||
VendorID int `orm:"column(vendor_id)" json:"vendorID"`
|
||||
VendorActID string `orm:"column(vendor_act_id);size(48)" json:"vendorActID"`
|
||||
SyncStatus int `orm:"default(2)" json:"syncStatus"`
|
||||
}
|
||||
|
||||
type ActVendorInfo struct {
|
||||
model.Act
|
||||
VendorList []*ActMapPureInfo `json:"vendorList"`
|
||||
}
|
||||
|
||||
type tPreCreateActVendorInfo struct {
|
||||
VendorID int
|
||||
|
||||
@@ -505,29 +494,6 @@ func QueryActs(ctx *jxcontext.Context, actID int, offset, pageSize int, keyword
|
||||
return dao.QueryActs(dao.GetDB(), actID, offset, pageSize, keyword, vendorID, statusList, actTypeList, storeID, skuID, cityCode, beginAt, endAt, createdAtFrom, createdAtTo)
|
||||
}
|
||||
|
||||
func GetActVendorInfo(ctx *jxcontext.Context, actID int) (actVendorInfo *ActVendorInfo, err error) {
|
||||
db := dao.GetDB()
|
||||
actMap, err := dao.GetActVendorInfo(db, actID, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(actMap) == 0 {
|
||||
return nil, fmt.Errorf("不能找到活动:%d", actID)
|
||||
}
|
||||
actVendorInfo = &ActVendorInfo{}
|
||||
for vendorID, v := range actMap {
|
||||
if actVendorInfo.ID == 0 {
|
||||
actVendorInfo.Act = v.Act
|
||||
}
|
||||
actVendorInfo.VendorList = append(actVendorInfo.VendorList, &ActMapPureInfo{
|
||||
VendorID: vendorID,
|
||||
SyncStatus: v.SyncStatus,
|
||||
VendorActID: v.VendorActID,
|
||||
})
|
||||
}
|
||||
return actVendorInfo, err
|
||||
}
|
||||
|
||||
func GetActStoreSkuInfo(ctx *jxcontext.Context, actID int, vendorIDs []int) (actStoreSkuList []*model.ActStoreSku2, err error) {
|
||||
db := dao.GetDB()
|
||||
actStoreSkuMap, err := dao.GetActStoreSkuVendorInfo(db, actID, vendorIDs, nil, nil)
|
||||
|
||||
Reference in New Issue
Block a user