UserApi::save_user_privacy PHP Method

save_user_privacy() public method

保存用户隐私设置 --using
public save_user_privacy ( ) : array
return array 状态+提示
    public function save_user_privacy()
    {
        $map['uid'] = $this->mid;
        if (isset($this->data['message'])) {
            $map['key'] = 'message';
            $key = 'message';
            $value = intval($this->data['message']);
            D('user_privacy')->where($map)->delete();
            $map['value'] = $value;
            $res = D('user_privacy')->add($map);
        }
        if (isset($this->data['comment_weibo'])) {
            $map['key'] = 'comment_weibo';
            $key = 'comment_weibo';
            $value = intval($this->data['comment_weibo']);
            D('user_privacy')->where($map)->delete();
            $map['value'] = $value;
            $res = D('user_privacy')->add($map);
        }
        if (isset($this->data['space'])) {
            $map['key'] = 'space';
            $key = 'space';
            $value = intval($this->data['space']);
            D('user_privacy')->where($map)->delete();
            $map['value'] = $value;
            $res = D('user_privacy')->add($map);
        }
        // if($res){
        return array('status' => 1, 'msg' => '设置成功');
        // }else{
        // return array('status'=>0,'msg'=>'设置失败');
        // }
    }