lip 1 день назад
Родитель
Сommit
a73f0b8641
3 измененных файлов с 25 добавлено и 5 удалено
  1. 3 3
      app/Http/Controllers/admin/Sport.php
  2. 21 2
      app/Http/Controllers/api/Wallet.php
  3. 1 0
      routes/api.php

+ 3 - 3
app/Http/Controllers/admin/Sport.php

@@ -135,9 +135,9 @@ class Sport extends Controller
             $info['odds'] = $info['odds'] ? SportModel::doOdds($info['odds'], $info['odd_values_locked']) : null;
             $info['event'] = SportEvent::where('data_id', $info['data_id'])->get();
 
-            $info['home_team'] = SportTeam::getTeamName($info['home_team_id']) ?? $info['home_team_en'];
-            $info['guest_team'] = SportTeam::getTeamName($info['guest_team_id']) ?? $info['guest_team_en'];
-            $info['league'] = SportLeague::getLeagueName($info['league']) ?? $info['league_en'];
+            $info['home_team'] = $info['home_team'] ?? SportTeam::getTeamName($info['home_team_id']);
+            $info['guest_team'] = $info['guest_team'] ?? SportTeam::getTeamName($info['guest_team_id']);
+            $info['league'] = $info['league'] ?? SportLeague::getLeagueName($info['league']);
 
         } catch (Exception $e) {
             return $this->error(HttpStatus::CUSTOM_ERROR,$e->getMessage());

+ 21 - 2
app/Http/Controllers/api/Wallet.php

@@ -6,6 +6,7 @@ use App\Services\WalletService;
 use App\Services\ConfigService;
 use App\Models\Config;
 use App\Models\Recharge;
+use App\Services\Payment\SanJinService;
 use Illuminate\Validation\ValidationException;
 
 use Exception;
@@ -16,8 +17,24 @@ use Exception;
 class Wallet extends BaseController
 {
 
+    //获取三斤充值通道(微信、支付宝、扫码充值)
+    public function getChannel()
+    {
+        $data = SanJinService::getChannel();
+        $list = [];
+        foreach($data as $k => $v) {
+            $list[] = [
+                    'label' => lang($v),
+                    'value' => $k,
+                ];
+        }
+        return $this->success([
+            'list' => $list,
+        ]);
+    }
+
     /**
-     * 获取充值二维码(微信、支付宝、扫码充值)
+     * 获取充值二维码(USDT充值)
      */
     function scan()
     {
@@ -33,8 +50,10 @@ class Wallet extends BaseController
             //手动充值
             if ($type === "TRC20") {
                 $address = Config::where('field', 'receiving_address')->first()->val;
-            } else {//if ($type === "ERC20")
+            } elseif ($type === "ERC20") {
                 $address = Config::where('field', 'receiving_address_erc20')->first()->val;
+            } else {
+                return $this->error(lang('充值类型错误'));
             }
             $res = WalletService::getPlatformImageAddress($address);
             $res['net'] = $type;

+ 1 - 0
routes/api.php

@@ -83,6 +83,7 @@ Route::middleware('check.token')->group(function () {
     Route::prefix('/wallet')->group(function () {
         Route::get("/scan", [Wallet::class, 'scan']);
         Route::post("/recharge", [Wallet::class, 'recharge']);
+        Route::get("/channel", [Wallet::class, 'getChannel']);
     });
 });