This commit is contained in:
2025-08-14 17:52:24 +08:00
parent 281248fd04
commit d8af126088
5 changed files with 19 additions and 19 deletions

View File

@@ -2,8 +2,8 @@
namespace app\api\model; namespace app\api\model;
use ba\Random; use extend\ba\Random;
use think\facade\Cache; use support\think\Cache;
use think\facade\Validate; use think\facade\Validate;
use think\Model; use think\Model;
@@ -18,7 +18,7 @@ class Msg extends Model
} }
$send_time = Cache::get($event . $phone); $send_time = Cache::get($event . $phone);
if($send_time && time() - $send_time < 60) { if($send_time && time() - $send_time < 60) {
return returnErrorData('发送频繁请稍后再试'); // return returnErrorData('发送频繁请稍后再试');
}else { }else {
Cache::set($event . $phone, time()); Cache::set($event . $phone, time());
} }

View File

@@ -18,9 +18,9 @@ class TbUser extends BaseModel
public static function GetByusername($username, $field = 'phone') public static function GetByusername($username, $field = 'phone')
{ {
// 全表扫描username // 全表扫描username
$dbmap = config('database.db_map'); $dbmap = config('think-orm.db_map');
foreach ($dbmap as $dbname) { 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); $connect = Db::connect($dbname);
$data = $connect->name('tb_user')->where([$field => $username])->find(); $data = $connect->name('tb_user')->where([$field => $username])->find();
if($data) { if($data) {
@@ -35,10 +35,10 @@ class TbUser extends BaseModel
public static function GetByuserInvite($inviter_code) public static function GetByuserInvite($inviter_code)
{ {
// // 全表扫描username // // 全表扫描username
// $dbmap = config('database.db_map'); // $dbmap = config('think-orm.db_map');
// $count = 0; // $count = 0;
// foreach ($dbmap as $dbname) { // 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); // $connect = Db::connect($dbname);
// $data = $connect->name('tb_user')->where(['inviter_code' => $inviter_code])->count(); // $data = $connect->name('tb_user')->where(['inviter_code' => $inviter_code])->count();
// $count += $data; // $count += $data;
@@ -69,11 +69,11 @@ class TbUser extends BaseModel
return $data_list; return $data_list;
// $dbmap = config('database.db_map'); // $dbmap = config('think-orm.db_map');
// $data_list = []; // $data_list = [];
// foreach ($dbmap as $dbname) { // 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); // $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(); // $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) { // if($data_arr) {
@@ -104,9 +104,9 @@ class TbUser extends BaseModel
public static function GetByinvitationCode($invitation_code) public static function GetByinvitationCode($invitation_code)
{ {
// 全表扫描username // 全表扫描username
$dbmap = config('database.db_map'); $dbmap = config('think-orm.db_map');
foreach ($dbmap as $dbname) { 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); $connect = Db::connect($dbname);
$data = $connect->name('tb_user')->where(['invitation_code' => $invitation_code])->find(); $data = $connect->name('tb_user')->where(['invitation_code' => $invitation_code])->find();
if($data) { if($data) {
@@ -121,9 +121,9 @@ class TbUser extends BaseModel
public static function GetByinviterCodeCount($inviter_code) public static function GetByinviterCodeCount($inviter_code)
{ {
// 全表扫描username // 全表扫描username
$dbmap = config('database.db_map'); $dbmap = config('think-orm.db_map');
foreach ($dbmap as $dbname) { 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); $connect = Db::connect($dbname);
$data = $connect->name('tb_user')->where(['inviter_code' => $inviter_code])->count(); $data = $connect->name('tb_user')->where(['inviter_code' => $inviter_code])->count();
if($data) { if($data) {
@@ -281,7 +281,7 @@ class TbUser extends BaseModel
public static function selectUserByIdNew($user) 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(); $userVip = $db->name('user_vip')->where(['user_id' => $user['user_id']])->find();
$db->close(); $db->close();
if ($userVip) { if ($userVip) {

View File

@@ -2,9 +2,9 @@
namespace app\common\library; namespace app\common\library;
use app\czg\app\model\TbUser; use app\api\model\TbUser;
use app\api\model\TbUserBlacklist; 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\Common;
use app\common\model\SysUser; use app\common\model\SysUser;
use app\utils\JwtUtils; use app\utils\JwtUtils;
@@ -359,7 +359,7 @@ class Auth
$userInfo = DatabaseRoute::getDb('user_info', $this->model['user_id'])->find(); $userInfo = DatabaseRoute::getDb('user_info', $this->model['user_id'])->find();
if($userInfo && $userInfo['cert_no']) { 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) { if($userBlack) {
$this->setError('系统正在维护中,请稍后再试!'); $this->setError('系统正在维护中,请稍后再试!');
return false; return false;

View File

@@ -16,7 +16,7 @@ use app\common\facade\Token;
use app\common\controller\Frontend; use app\common\controller\Frontend;
use app\api\validate\User as UserValidate; use app\api\validate\User as UserValidate;
class LoginControllerController extends BaseController class LoginController extends BaseController
{ {
protected array $noNeedLogin = ['*']; protected array $noNeedLogin = ['*'];

View File

@@ -1,6 +1,6 @@
<?php <?php
namespace ba; namespace extend\ba;
class Random class Random
{ {