1
This commit is contained in:
@@ -3586,8 +3586,6 @@ func GetSkuNamesNew(ctx *jxcontext.Context, keyword string, skuIDs, skuNameIDs [
|
||||
panic(r)
|
||||
}
|
||||
}()
|
||||
globals.SugarLogger.Debugf("------sql := %s", sql)
|
||||
globals.SugarLogger.Debugf("------sqlParams := %s", utils.Format4Output(sqlParams, false))
|
||||
if err = dao.GetRowsTx(txDB, &skuNamesInfo.SkuNames, sql, sqlParams...); err == nil {
|
||||
skuNamesInfo.TotalCount = dao.GetLastTotalRowCount2(db, txDB)
|
||||
dao.Commit(db, txDB)
|
||||
@@ -3620,7 +3618,6 @@ func GetSkuNamesNew(ctx *jxcontext.Context, keyword string, skuIDs, skuNameIDs [
|
||||
`
|
||||
sqlParams := []interface{}{v.ID, model.ThingTypeSku, "320406", "379599", "390558", utils.DefaultTimeValue} // 京东到家菜市,果切,宠物
|
||||
dao.GetRows(db, &things, sql, sqlParams)
|
||||
globals.SugarLogger.Debugf("------things := %s", utils.Format4Output(things, false))
|
||||
skusVendor := &model.SkuWithVendor{
|
||||
Sku: v,
|
||||
MapList: things,
|
||||
|
||||
@@ -218,6 +218,27 @@ func GetSkuNames(db *DaoDB, nameIDs []int, upcs []string, name string, isExd boo
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func GetSkuNamesByAttr(db *DaoDB, mtAttr string) (skuNameList []*model.SkuName, err error) {
|
||||
sql := `
|
||||
SELECT t1.*
|
||||
FROM sku_name t1
|
||||
WHERE t1.deleted_at = ?
|
||||
`
|
||||
sqlParams := []interface{}{
|
||||
utils.DefaultTimeValue,
|
||||
}
|
||||
|
||||
if mtAttr != "" {
|
||||
sql += " AND t1.mt_attribute LIKE ?"
|
||||
sqlParams = append(sqlParams, "%"+mtAttr+"%")
|
||||
}
|
||||
|
||||
if err = GetRows(db, &skuNameList, sql, sqlParams...); err == nil {
|
||||
return skuNameList, nil
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func GetSkuIDByNames(db *DaoDB, nameIDs []int) (skuIDs []int, err error) {
|
||||
skuList, err := GetSkus(db, nil, nameIDs, nil, nil, nil)
|
||||
if err == nil {
|
||||
|
||||
@@ -565,6 +565,11 @@ func SwitchAttr(apiObj *mtwmapi.API, vendorStoreID string, vendorCatID int64, na
|
||||
Value: "其他",
|
||||
}}
|
||||
}
|
||||
} else if v.AttrID == mtwmapi.SpecialAttrOrigin { // 产地默认国产
|
||||
attrValue.ValueList = []ValueList{{
|
||||
ValueID: 1300000003,
|
||||
Value: "国产",
|
||||
}}
|
||||
} else {
|
||||
if len(v.ValueList) > 0 {
|
||||
attrValue.ValueList = []ValueList{{
|
||||
|
||||
Reference in New Issue
Block a user