['loginName'], ]; protected function checkLoginName($value){ $where = []; $where['dataFlag'] = 1; $where['loginName'] = $value; if((int)input('userId')>0){ $where['userId'] = ['<>',(int)input('post.userId')]; } $rs = Db::name('users')->where($where)->count(); return ($rs==0)?true:'该登录账号已存在'; } }