示例#1
0
        /// <summary>
        /// 获取周边美食
        /// </summary>
        /// <param name="wid"></param>
        /// <param name="keywords"></param>
        /// <param name="recommend"></param>
        /// <returns></returns>
        public List <POIDto> GetCateringShops(int wid, string keywords, bool recommend = false)
        {
            BLL.wx_diancai_shopinfo bll = new BLL.wx_diancai_shopinfo();

            string strWhere = string.Format("wid={0}", wid);

            if (!string.IsNullOrEmpty(keywords))
            {
                strWhere += string.Format("  And hotelName Like '%{0}%'", keywords);
            }

            if (recommend)
            {
                strWhere += " And Recommend=1";
            }

            var shops = bll.GetModelList(strWhere);

            if (shops.Any())
            {
                return(shops.Select(s => new POIDto
                {
                    Id = s.id,
                    Name = s.hotelName,
                    Introduction = s.hotelintroduction,
                    Logo = s.hotelLogo,
                    Lat = (double)(s.xplace.HasValue ? s.xplace.Value : 0),
                    Lng = (double)(s.yplace.HasValue ? s.yplace.Value : 0),
                    PoiType = "catering"
                }).ToList());
            }

            return(null);
        }