Merge branch 'pro' into pro
This commit is contained in:
@@ -25,7 +25,6 @@ use Arr;
|
||||
use Cache;
|
||||
use Captcha;
|
||||
use Carbon\Carbon;
|
||||
use Hedeqiang\UMeng\Facades\Push;
|
||||
use Request;
|
||||
|
||||
/**
|
||||
@@ -49,6 +48,7 @@ class UsersController extends AbstractController
|
||||
* @apiParam {String} email 邮箱
|
||||
* @apiParam {String} password 密码
|
||||
* @apiParam {String} [code] 登录验证码
|
||||
* @apiParam {String} [code_key] 验证码通过key验证
|
||||
* @apiParam {String} [invite] 注册邀请码
|
||||
*
|
||||
* @apiSuccess {Number} ret 返回状态码(1正确、0错误)
|
||||
@@ -86,10 +86,16 @@ class UsersController extends AbstractController
|
||||
$needCode = !Base::isError(User::needCode($email));
|
||||
if ($needCode) {
|
||||
$code = trim(Request::input('code'));
|
||||
$codeKey = trim(Request::input('code_key'));
|
||||
if (empty($code)) {
|
||||
return Base::retError('请输入验证码', ['code' => 'need']);
|
||||
}
|
||||
if (!Captcha::check($code)) {
|
||||
if ($codeKey) {
|
||||
$check = Captcha::check_api($code, $codeKey);
|
||||
} else {
|
||||
$check = Captcha::check($code);
|
||||
}
|
||||
if (!$check) {
|
||||
return Base::retError('请输入正确的验证码', ['code' => 'need']);
|
||||
}
|
||||
}
|
||||
@@ -457,7 +463,7 @@ class UsersController extends AbstractController
|
||||
*
|
||||
* @apiParam {Object} keys 搜索条件
|
||||
* - keys.key 昵称、拼音、邮箱关键字
|
||||
* - keys.disable 0-排除禁止(默认),1-仅禁止,2-含禁止
|
||||
* - keys.disable 0-排除离职(默认),1-仅离职,2-含离职
|
||||
* - keys.bot 0-排除机器人(默认),1-仅机器人,2-含机器人
|
||||
* - keys.project_id 在指定项目ID
|
||||
* - keys.no_project_id 不在指定项目ID
|
||||
@@ -534,7 +540,12 @@ class UsersController extends AbstractController
|
||||
if (in_array($sorts['az'], ['asc', 'desc'])) {
|
||||
$builder->orderBy('az', $sorts['az']);
|
||||
} else {
|
||||
$builder->orderBy('bot');
|
||||
if (intval($keys['disable']) == 2) {
|
||||
$builder->orderBy('disable_at');
|
||||
}
|
||||
if (intval($keys['bot']) == 2) {
|
||||
$builder->orderBy('bot');
|
||||
}
|
||||
}
|
||||
//
|
||||
if (Request::exists('page')) {
|
||||
|
||||
Reference in New Issue
Block a user