|
12345678910111213141516171819202122 |
- package db
-
- import (
- "applet/app/db/model"
- "xorm.io/xorm"
- )
-
- func FindSkuByGoodsID(engine *xorm.Engine, goodsId string) ([]*model.Sku, error) {
- var skus []*model.Sku
- err := engine.Where("goods_id = ?", goodsId).Find(&skus)
- return skus, err
- }
-
- func GetMallSkuBySkuCode(engine *xorm.Engine, skuCode, goodsId string) (isHas bool, mm *model.Sku, err error) {
- isHas = false
- var m model.Sku
- isHas, err = engine.Where("sku_code=?", skuCode).And("goods_id!=?", goodsId).Get(&m)
- if err != nil {
- return isHas, &m, err
- }
- return isHas, &m, nil
- }
|