package back

import (
	"demo/configs"
	"demo/data/domain"
)

func SetGoodsSku(goodsSkuMap map[string]interface{}, id int64) (domain.GoodsSku, bool, error) {
	var goodsSku domain.GoodsSku
	delete(goodsSkuMap, "id")
	_, err := configs.Engine.Table("goods_sku").Where("id = ?", id).Update(goodsSkuMap)
	if err != nil {
		return goodsSku, false, err
	}
	return goodsSku, true, nil
}
