//查讯用户输入错误次数
$invite_code = $params['code']; //获取输入的邀请码
$chekc_key = xxxxx; //设置key
$check_key = sprintf($check_key,$uid); //关系用户ID
$number = $this->redis->get($check_key);
if(3 <= $number){
echo '现在是锁定状态';
}
//查数据库,看是否有code
$code = "select code from user where uid = 'xxx' and invite_code = 'xxx' ";
if(empty($code)|| $code){
$this->redis->incr($check_key);
$this->redis->expire($check_key,24*3600);
echo '邀请码有误';
}