正在显示
1 个修改的文件
包含
12 行增加
和
9 行删除
@@ -350,16 +350,19 @@ class Cms extends Api | @@ -350,16 +350,19 @@ class Cms extends Api | ||
350 | $channel = $channel->toArray(); | 350 | $channel = $channel->toArray(); |
351 | $channel['url'] = $channel['fullurl']; | 351 | $channel['url'] = $channel['fullurl']; |
352 | 352 | ||
353 | - $map_log['user_id']=$user_id; | ||
354 | - $map_log['article_id']=$article_id; | ||
355 | - $log=CmsLikeLog::get($map_log); | ||
356 | - if (empty($log)){ | ||
357 | - $archives['is_like']=0; | ||
358 | - }else{ | ||
359 | - $archives['is_like']=1; | 353 | + if (!empty($user_id)){ |
354 | + $map_log['user_id']=$user_id; | ||
355 | + $map_log['article_id']=$article_id; | ||
356 | + $log=CmsLikeLog::get($map_log); | ||
357 | + if (empty($log)){ | ||
358 | + $archives['is_like']=0; | ||
359 | + }else{ | ||
360 | + $archives['is_like']=1; | ||
361 | + } | ||
362 | + $archives['read_score']=$get_score; | ||
363 | + unset($channel['channeltpl'], $channel['listtpl'], $channel['showtpl'], $channel['status'], $channel['weigh'], $channel['parent_id']); | ||
360 | } | 364 | } |
361 | - $archives['read_score']=$get_score; | ||
362 | - unset($channel['channeltpl'], $channel['listtpl'], $channel['showtpl'], $channel['status'], $channel['weigh'], $channel['parent_id']); | 365 | + |
363 | $this->success('', ['archivesInfo' => $archives,'commentList' => $commentList]); | 366 | $this->success('', ['archivesInfo' => $archives,'commentList' => $commentList]); |
364 | } | 367 | } |
365 | 368 |
-
请 注册 或 登录 后发表评论