diff --git a/app/controller/Article.php b/app/controller/Article.php index d46bd90..de79bc7 100644 --- a/app/controller/Article.php +++ b/app/controller/Article.php @@ -80,6 +80,9 @@ class Article $article_id = $GLOBALS['data']['data']['article_id']; $info = Db::name('app_article')->where("id",$article_id)->find(); if(empty($info)) return show("找不到该动态信息!"); + if(!empty($info['imgs'])) { + $info['imgs'] = json_decode(str_replace(['{', '}'], ['[', ']'], imgs['imgs']), true); + } $info['other_list'] = []; $lists = Db::name('app_article') ->where("userid",$info["userid"]) @@ -88,8 +91,9 @@ class Article ->limit(env("page_count")) ->select(); foreach($lists as $vo){ - - $vo['imgs'] = json_decode(str_replace(['{','}'],['[',']'],$vo['imgs']),true); + if(!empty($vo['imgs'])) { + $vo['imgs'] = json_decode(str_replace(['{', '}'], ['[', ']'], $vo['imgs']), true); + } $info['other_list'][] = $vo; } $info['userinfo']=[];