2021-10-07

获取当前用户的视频收藏列表,可用于判断,是否已经收藏该影片

 

下面是PHP代码

 

 

$h2_ufav_where=array();
$h2_ufav_where['user_id'] = $GLOBALS['user']['user_id'];
$h2_ufav_where['ulog_type'] = 2;
$h2_ufav_data = model('Ulog')->listData($h2_ufav_where,'ulog_id desc',1,9999);

foreach ($h2_ufav_data['list'] as $k => $v) {
  if($v['ulog_mid'] == 1){
          $h2_ufav_vlist[] = $v['ulog_rid'];
  }elseif($v['ulog_mid'] == 2){
          $h2_ufav_alist[] = $v['ulog_rid'];
  }elseif($v['ulog_mid'] == 3){
    $h2_ufav_tlist[] = $v['ulog_rid'];
  }
}
$h2_ufav_vlist = array_unique($h2_ufav_vlist);//视频
$h2_ufav_alist = array_unique($h2_ufav_alist);//文章
$h2_ufav_tlist = array_unique($h2_ufav_tlist);//专题

 

 

打赏

好文章,更需要你的鼓励

本文由 氢设计 创作,除注明转载/出处外,均为本站原创,转载前请务必署名

最后编辑时间为:2021-11-23 10:21:01

本文链接:https://www.h2sheji.com/show-122.html