Ken 2 minggu lalu
induk
melakukan
bafcf2c3cb

+ 1 - 1
app/Models/User.php

@@ -12,7 +12,7 @@ namespace App\Models;
 class User extends BaseModel
 {
     protected $table = 'users';
-    protected $fillable = ['usdt', 'member_id', 'first_name', 'game_id', 'username', 'secret_key', 'secret_pass', 'language'];
+    protected $fillable = ['usdt', 'is_banned', 'admin_note', 'member_id', 'first_name', 'game_id', 'username', 'secret_key', 'secret_pass', 'language'];
     protected $attributes = [
         'language' => 'zh',
     ];

+ 14 - 1
app/Services/BetService.php

@@ -173,6 +173,19 @@ class BetService extends BaseService
             return $msg;
         }
 
+        //是否封号
+        $isBanned = UserService::getIsBanned($memberId);
+        if ($isBanned) {
+            $text = lang("账号异常") . "\n";
+            $text .= lang("任何疑问都可以联系唯一客服") . ":@{$serviceAccount}";
+            $msg['text'] = $text;
+            if ($messageId) {
+                $msg['reply_to_message_id'] = $messageId;
+            }
+            return $msg;
+        }
+
+
         if ($betResult == null) {
             $text = lang("消息格式错误!") . "\n";
             $text .= lang("任何疑问都可以联系唯一客服") . ":@{$serviceAccount}";
@@ -404,7 +417,7 @@ class BetService extends BaseService
         }
 
         //系统维护
-        $maintenanceSwitch = Config::where('field','maintenance_switch')->first()->val;
+        $maintenanceSwitch = Config::where('field', 'maintenance_switch')->first()->val;
         if ($maintenanceSwitch != 0) {
             echo "系统维护中\n";
             return;

+ 11 - 3
app/Services/UserService.php

@@ -94,10 +94,10 @@ class UserService extends BaseService
     public static function paginate(array $search = [])
     {
         $limit = isset($search['limit']) ? $search['limit'] : 15;
-        $paginator = self::model()::where(self::getWhere($search))->with(['wallet' => function($query) {
+        $paginator = self::model()::where(self::getWhere($search))->with(['wallet' => function ($query) {
             // 使用 select 但确保包含外键
             $query->select('id', 'user_id', 'member_id', 'address', 'available_balance');
-        }])->orderByDesc('created_at') ->paginate($limit);
+        }])->orderByDesc('created_at')->paginate($limit);
 
         return ['total' => $paginator->total(), 'data' => $paginator->items()];
     }
@@ -133,11 +133,19 @@ class UserService extends BaseService
             $language = preg_replace('/^setLanguage@@/', '', $data);
             $res = UserService::setLanguage($chatId, $language);
             $telegram->deleteMessage(['chat_id' => $chatId, 'message_id' => $messageId]);
-            TelegramWebHook::setReplyKeyboard($chatId,$language);
+            TelegramWebHook::setReplyKeyboard($chatId, $language);
 //            $telegram->sendMessage($res);
         }
     }
 
+
+    public static function getIsBanned($memberId)
+    {
+        $user = User::where('member_id', $memberId)->first();
+        return $user->is_banned == 1;
+    }
+
+
     public static function setLanguage($chatId, $language): array
     {
         $userInfo = self::findOne(['member_id' => $chatId]);

+ 31 - 0
database/migrations/2026_01_12_161517_update_users.php

@@ -0,0 +1,31 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration {
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('users', function (Blueprint $table) {
+            $table->tinyInteger('is_banned')->default(0)->comment('是否封号:0正常;1封号');
+            $table->string('admin_note')->default('')->comment('管理员备注');
+        });
+
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        //
+    }
+};

+ 1 - 0
lang/en/messages.php

@@ -316,6 +316,7 @@ return [
     "玩家" => "Player",
     "倍率" => "Odds",
     "钱包流水记录" => "Wallet Transaction Record",
+    "账号异常" => "Account anomaly",
 
 
 

+ 4 - 4
lang/vi/messages.php

@@ -308,15 +308,15 @@ return [
     "尾数" => "Chữ số cuối cùng",
     "生成时间" => "Thời gian tạo",
     "数据仅供参考" => "Dữ liệu chỉ để tham khảo",
-    "期"=>"Số",
-    "合计金额"=>"Tổng số tiền",
+    "期" => "Số",
+    "合计金额" => "Tổng số tiền",
     "第" => "Số",
     "开奖时间" => "Thời gian quay số",
     "投注截止" => "Thời gian đóng cược",
     "玩家" => "Người chơi",
     "倍率" => "Tỷ lệ",
-    "钱包流水记录"=>"Ghi chép dòng tiền ví",
-
+    "钱包流水记录" => "Ghi chép dòng tiền ví",
+    "账号异常" => "Tài khoản bất thường",
 
 
 ];

+ 4 - 6
lang/zh/messages.php

@@ -313,12 +313,10 @@ return [
     "第" => "第",
     "开奖时间" => "开奖时间",
     "投注截止" => "投注截止",
-    "玩家"=>"玩家",
-    "倍率"=>"倍率",
-    "钱包流水记录"=>"钱包流水记录",
-
-
-
+    "玩家" => "玩家",
+    "倍率" => "倍率",
+    "钱包流水记录" => "钱包流水记录",
+    "账号异常" => "账号异常",
 
 
 ];