public function channel_follow()
{
$cids = t($this->data['channel_category_id']);
$cids = explode(',', $cids);
$type = intval($this->data['type']);
if ($type == 1) {
// 加关注
$action = 'add';
$info = '关注';
} else {
$action = 'del';
$info = '取消关注';
}
foreach ($cids as $cid) {
$res = D('ChannelFollow', 'channel')->upFollow($this->mid, $cid, $action);
}
if ($res) {
$data['status'] = 1;
$data['msg'] = $info . '成功';
} else {
$data['status'] = 0;
$data['msg'] = $info . '失败';
}
return $data;
}