add
This commit is contained in:
parent
281248fd04
commit
d8af126088
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
namespace app\api\model;
|
||||
|
||||
use ba\Random;
|
||||
use think\facade\Cache;
|
||||
use extend\ba\Random;
|
||||
use support\think\Cache;
|
||||
use think\facade\Validate;
|
||||
use think\Model;
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ class Msg extends Model
|
|||
}
|
||||
$send_time = Cache::get($event . $phone);
|
||||
if($send_time && time() - $send_time < 60) {
|
||||
return returnErrorData('发送频繁请稍后再试');
|
||||
// return returnErrorData('发送频繁请稍后再试');
|
||||
}else {
|
||||
Cache::set($event . $phone, time());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@ class TbUser extends BaseModel
|
|||
public static function GetByusername($username, $field = 'phone')
|
||||
{
|
||||
// 全表扫描username
|
||||
$dbmap = config('database.db_map');
|
||||
$dbmap = config('think-orm.db_map');
|
||||
foreach ($dbmap as $dbname) {
|
||||
if(!in_array($dbname, config('database.unset_db_map'))) {
|
||||
if(!in_array($dbname, config('think-orm.unset_db_map'))) {
|
||||
$connect = Db::connect($dbname);
|
||||
$data = $connect->name('tb_user')->where([$field => $username])->find();
|
||||
if($data) {
|
||||
|
|
@ -35,10 +35,10 @@ class TbUser extends BaseModel
|
|||
public static function GetByuserInvite($inviter_code)
|
||||
{
|
||||
// // 全表扫描username
|
||||
// $dbmap = config('database.db_map');
|
||||
// $dbmap = config('think-orm.db_map');
|
||||
// $count = 0;
|
||||
// foreach ($dbmap as $dbname) {
|
||||
// if(!in_array($dbname, config('database.unset_db_map'))) {
|
||||
// if(!in_array($dbname, config('think-orm.unset_db_map'))) {
|
||||
// $connect = Db::connect($dbname);
|
||||
// $data = $connect->name('tb_user')->where(['inviter_code' => $inviter_code])->count();
|
||||
// $count += $data;
|
||||
|
|
@ -69,11 +69,11 @@ class TbUser extends BaseModel
|
|||
return $data_list;
|
||||
|
||||
|
||||
// $dbmap = config('database.db_map');
|
||||
// $dbmap = config('think-orm.db_map');
|
||||
// $data_list = [];
|
||||
// foreach ($dbmap as $dbname) {
|
||||
//
|
||||
// if(!in_array($dbname, config('database.unset_db_map'))) {
|
||||
// if(!in_array($dbname, config('think-orm.unset_db_map'))) {
|
||||
// $connect = Db::connect($dbname);
|
||||
// $data_arr = $connect->name('tb_user')->where(['inviter_code' => $invitation_code])->field('user_id,avatar,user_name,user_id')->limit(page($page, $limit), $limit)->select()->toArray();
|
||||
// if($data_arr) {
|
||||
|
|
@ -104,9 +104,9 @@ class TbUser extends BaseModel
|
|||
public static function GetByinvitationCode($invitation_code)
|
||||
{
|
||||
// 全表扫描username
|
||||
$dbmap = config('database.db_map');
|
||||
$dbmap = config('think-orm.db_map');
|
||||
foreach ($dbmap as $dbname) {
|
||||
if(!in_array($dbname, config('database.unset_db_map'))) {
|
||||
if(!in_array($dbname, config('think-orm.unset_db_map'))) {
|
||||
$connect = Db::connect($dbname);
|
||||
$data = $connect->name('tb_user')->where(['invitation_code' => $invitation_code])->find();
|
||||
if($data) {
|
||||
|
|
@ -121,9 +121,9 @@ class TbUser extends BaseModel
|
|||
public static function GetByinviterCodeCount($inviter_code)
|
||||
{
|
||||
// 全表扫描username
|
||||
$dbmap = config('database.db_map');
|
||||
$dbmap = config('think-orm.db_map');
|
||||
foreach ($dbmap as $dbname) {
|
||||
if(!in_array($dbname, config('database.unset_db_map'))) {
|
||||
if(!in_array($dbname, config('think-orm.unset_db_map'))) {
|
||||
$connect = Db::connect($dbname);
|
||||
$data = $connect->name('tb_user')->where(['inviter_code' => $inviter_code])->count();
|
||||
if($data) {
|
||||
|
|
@ -281,7 +281,7 @@ class TbUser extends BaseModel
|
|||
|
||||
public static function selectUserByIdNew($user)
|
||||
{
|
||||
$db = Db::connect(config('database.search_library'));
|
||||
$db = Db::connect(config('think-orm.search_library'));
|
||||
$userVip = $db->name('user_vip')->where(['user_id' => $user['user_id']])->find();
|
||||
$db->close();
|
||||
if ($userVip) {
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
namespace app\common\library;
|
||||
|
||||
use app\czg\app\model\TbUser;
|
||||
use app\api\model\TbUser;
|
||||
use app\api\model\TbUserBlacklist;
|
||||
use app\czg\app\model\UserInfo;
|
||||
use app\api\model\UserInfo;
|
||||
use app\common\model\Common;
|
||||
use app\common\model\SysUser;
|
||||
use app\utils\JwtUtils;
|
||||
|
|
@ -359,7 +359,7 @@ class Auth
|
|||
$userInfo = DatabaseRoute::getDb('user_info', $this->model['user_id'])->find();
|
||||
if($userInfo && $userInfo['cert_no']) {
|
||||
// 继续查黑名单表
|
||||
$userBlack = \app\czg\app\model\TbUserBlacklist::where(['id_card_no' => $userInfo['cert_no']])->find();
|
||||
$userBlack = TbUserBlacklist::where(['id_card_no' => $userInfo['cert_no']])->find();
|
||||
if($userBlack) {
|
||||
$this->setError('系统正在维护中,请稍后再试!');
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ use app\common\facade\Token;
|
|||
use app\common\controller\Frontend;
|
||||
use app\api\validate\User as UserValidate;
|
||||
|
||||
class LoginControllerController extends BaseController
|
||||
class LoginController extends BaseController
|
||||
{
|
||||
protected array $noNeedLogin = ['*'];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace ba;
|
||||
namespace extend\ba;
|
||||
|
||||
class Random
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue