You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
714 B

6 months ago
package service
import (
"shop-api/global"
"shop-api/model"
)
func GetSellerStoreInfo(uuid string) (err error, res model.SellerStoreInfo) {
err = global.MG_DB.Model(&model.SellerStore{}).Select("store_no,type,email,create_by").Where("create_by = ?", uuid).First(&res).Error
return
}
func getSellerStoreInfoMap(uuids []string) (err error, res map[string]model.SellerStoreInfo) {
var list []model.SellerStoreInfo
err = global.MG_DB.Model(&model.SellerStore{}).Select("store_no,type,email,create_by").Where("create_by IN (?)", uuids).Find(&list).Error
if err != nil {
return
}
res = make(map[string]model.SellerStoreInfo)
for i := 0; i < len(list); i++ {
res[list[i].CreateBy] = list[i]
}
return
}