package db

import (
	"context"
	"youngee_b_api/model/gorm_model"
)

// FindStoreById 根据门店ID查找门店信息
func FindStoreById(ctx context.Context, storeId int) (*gorm_model.Store, error) {
	db := GetReadDB(ctx)
	var storeInfo *gorm_model.Store
	whereCondition := gorm_model.Store{StoreId: storeId}
	err := db.Model(gorm_model.Store{}).Where(whereCondition).Find(&storeInfo).Error
	if err != nil {
		return nil, err
	}
	return storeInfo, nil
}
