comcms_core icon indicating copy to clipboard operation
comcms_core copied to clipboard

广告行情.biz.cs 少非空判断

Open chenqilscy opened this issue 7 years ago • 0 comments

第308行修改如下:

if (model!=null && model.TId == 4)

完整代码如下:

        /// <summary>
        /// 获取幻灯片广告
        /// </summary>
        /// <param name="aid">广告id</param>
        /// <returns></returns>
        public static List<ImgAds> GetSlideAds(int aid)
        {
            Ads model = new Ads();
            model = Find(_.Id == aid);
            if (model!=null && model.TId == 4)
            {
                List<ImgAds> listimg = new List<ImgAds>();
                listimg = JsonConvert.DeserializeObject<List<ImgAds>>(model.Content);
                return listimg;
            }
            return null;
        }

chenqilscy avatar Dec 20 '18 09:12 chenqilscy