Ken 2 hete
szülő
commit
c20ebf2111

+ 6 - 5
app/Services/TopUpService.php

@@ -178,9 +178,6 @@ class TopUpService
 
     public static function chooseAddress($chatId, $messageId)
     {
-//        $address = Config::where('field', 'receiving_address')->first()->val;
-//        $address1 = Config::where('field', 'receiving_address')->first()->val;
-
         $keyboard = [
             [
                 ['text' => 'TRC20', 'callback_data' => "topUp@@TRC20"],
@@ -203,7 +200,7 @@ class TopUpService
     }
 
     //获取充值二维码
-    public function scan($chatId, $messageId)
+    public function scan($chatId, $messageId, $type)
     {
 
         // $receivingType = Config::where('field', 'receiving_type')->first()->val;
@@ -216,7 +213,11 @@ class TopUpService
         } //
         //手动
         else {
-            $address = Config::where('field', 'receiving_address')->first()->val;
+            if ($type === "TRC20") {
+                $address = Config::where('field', 'receiving_address')->first()->val;
+            } elseif ($type === "ERC20") {
+                $address = Config::where('field', 'receiving_address_erc20')->first()->val;
+            }
             $res = WalletService::getPlatformImageAddress($address);
             $qrCode = $res['full_path'];
             Cache::put("{$chatId}_TOP_UP_ADDRESS", $address);

+ 36 - 0
database/migrations/2025_11_04_101429_insert_config.php

@@ -0,0 +1,36 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Support\Facades\DB;
+return new class extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        DB::table('config')->insert([
+            [
+                'field' => 'receiving_address_erc20',
+                'val' => "Trftghhnnbg6775tghy678ikuj9807ujht",
+                'remark' => '收款地址_ERC20',
+                'created_at' => now(),
+                'updated_at' => now(),
+            ],
+        ]);
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        //
+    }
+};