面包店
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

23 lines
547 B

  1. package db
  2. import (
  3. "applet/app/db/model"
  4. "xorm.io/xorm"
  5. )
  6. func FindSkuByGoodsID(engine *xorm.Engine, goodsId string) ([]*model.Sku, error) {
  7. var skus []*model.Sku
  8. err := engine.Where("goods_id = ?", goodsId).Find(&skus)
  9. return skus, err
  10. }
  11. func GetMallSkuBySkuCode(engine *xorm.Engine, skuCode, goodsId string) (isHas bool, mm *model.Sku, err error) {
  12. isHas = false
  13. var m model.Sku
  14. isHas, err = engine.Where("sku_code=?", skuCode).And("goods_id!=?", goodsId).Get(&m)
  15. if err != nil {
  16. return isHas, &m, err
  17. }
  18. return isHas, &m, nil
  19. }