作者 sgj
1 个管道 的构建 通过 耗费 1 秒

加入判断是否点击了喜欢

... ... @@ -70,7 +70,7 @@ class GroupModel extends Model
public function getFriendsInfo($group_id){
$map['t.delete_time']=null;
$map['t.group_id']=$group_id;
$user_id= cmf_get_current_user_id();
$info=db('group_text')
->alias('t')
->field('u.avatar,u.user_login,t.*,t.id as text_id')
... ... @@ -82,6 +82,7 @@ class GroupModel extends Model
->toArray();
foreach ($info as $k=>$v){
$info[$k]['like']=$this->getLIke($v['text_id']);
$info[$k]['is_like']=in_array($user_id,$info[$k]['like']);
$info[$k]['comment']=$this->getComment($v['text_id']);
}
return $info;
... ...
... ... @@ -58,6 +58,7 @@
<div>
<div class='list_content'>{$v.content}</div>
<switch name="v.pic_num">
<case value="1">
<div class='list_img_box'>
<volist name="pic.photos" id="vo">
... ... @@ -65,6 +66,7 @@
</volist>
</div>
</case>
<case value="4">
<div class='list_img_box'>
<volist name="pic.photos" id="vo">
... ... @@ -80,6 +82,7 @@
</volist>
</div>
</case>
</switch>
</div>
... ...