UserApi::follow PHP Method

follow() public method

关注一个用户 --using
public follow ( ) : array
return array 状态+提示+关注状态
    public function follow()
    {
        if (empty($this->mid) || empty($this->user_id)) {
            return array('status' => 0, 'msg' => '参数错误');
        }
        $r = model('Follow')->doFollow($this->mid, $this->user_id);
        if ($r) {
            $r['status'] = 1;
            $r['msg'] = '关注成功';
            return $r;
        } else {
            return array('status' => 0, 'msg' => model('Follow')->getLastError());
        }
    }