|
@@ -258,6 +258,28 @@ class Topicdongtai extends Api
|
|
|
->order($orderby)->autopage()->select();
|
|
|
$list = list_domain_image($list,['images','avatar']);
|
|
|
|
|
|
+ //追加是否点赞
|
|
|
+ if(!empty($list)){
|
|
|
+ $ids = array_column($list,'id');
|
|
|
+ $map = [
|
|
|
+ 'dt_id' => ['IN',$ids],
|
|
|
+ 'user_id' => $this->auth->id,
|
|
|
+ ];
|
|
|
+ $good_list = Db::name('topic_dongtai_good')->where('dt_id','IN',$ids)->select();
|
|
|
+
|
|
|
+ foreach($list as $key => $val){
|
|
|
+ $list[$key]['isgood'] = 0;
|
|
|
+
|
|
|
+ foreach($good_list as $k => $v){
|
|
|
+ if($val['id'] == $v['dt_id']){
|
|
|
+ $list[$key]['isgood'] = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
$this->success('success',$list);
|
|
|
}
|
|
|
|