Ken 1 month ago
parent
commit
37512ab2e8

+ 6 - 2
app/Http/Controllers/Api/Test.php

@@ -4,6 +4,7 @@
 
 
 use App\Http\Controllers\Controller;
 use App\Http\Controllers\Controller;
 use App\Services\ApiFootball\Client;
 use App\Services\ApiFootball\Client;
+use App\Services\FixtureService;
 
 
 
 
 class Test extends Controller
 class Test extends Controller
@@ -12,11 +13,14 @@ public function index()
     {
     {
 //        $data = $this->football('/countries',[]);
 //        $data = $this->football('/countries',[]);
 //        $data = $this->football('/leagues',['code'=>'DZ']);
 //        $data = $this->football('/leagues',['code'=>'DZ']);
-//        $data = $this->football('/fixtures', ['league' => 186, 'season' => '2024']);
+//        $data = $this->football('/fixtures', ['date' => '2026-03-05']);
 
 
+//        $data[] = Client::timezone();
+//        $data[] = $this->football('/fixtures', ['date' => '2026-03-05']);
 
 
-        $data =Client::fixtures(['league' => 186, 'season' => '2024']);
+//        $data[] =  $this->football('/odds',['fixture'=>'1491915']);
 
 
+        $data = FixtureService::a();
         return $this->success($data);
         return $this->success($data);
     }
     }
 
 

+ 14 - 0
app/Models/Sport.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace App\Models;
+
+class Sport extends BaseModel
+{
+    protected $table = 'sports';
+    protected $fillable = ['data_id','home_team_id','home_team_en','home_team','home_team_logo',
+    'guest_team_id','guest_team_en','guest_team','guest_team_logo',
+        'half_score','rbt','is_roll','score','league_en','league',
+        'odds','state','game_time','status'
+
+    ];
+}

+ 6 - 0
app/Services/ApiFootball/Client.php

@@ -57,6 +57,12 @@ public static function leagues($params = [])
         return static::get('leagues', $params);
         return static::get('leagues', $params);
     }
     }
 
 
+    public static function fixturesRounds($params = [])
+    {
+        return static::get('fixtures/rounds', $params);
+    }
+
+
     // 赛程
     // 赛程
     public static function fixtures($params = [])
     public static function fixtures($params = [])
     {
     {

+ 60 - 0
app/Services/FixtureService.php

@@ -0,0 +1,60 @@
+<?php
+
+namespace App\Services;
+
+use App\Models\Sport;
+use App\Services\ApiFootball\Client;
+use Carbon\Carbon;
+
+class FixtureService extends BaseService
+{
+    static function a()
+    {
+        $date = Carbon::tomorrow()->toDateString();
+        $data = Client::fixtures(['date' => $date]);
+        $data = $data['response'];
+        $tableData = [];
+        foreach ($data as $item) {
+            $status = [
+                'NS' => 0,
+                '1H' => 1,
+                'HT' => 1,
+                '2H' => 1,
+                'ET' => 1,
+                'BT' => 1,
+                'P' => 1,
+                'SUSP' => 1,
+                'INT' => 1,
+                'LIVE' => 1,
+                'FT' => 2,
+                'AET' => 2,
+                'PEN' => 2,
+                'PST' => 3,
+                'CANC' => 4,
+                'ABD' => 4,
+            ];
+            $tableData[] = [
+                'data_id' => $item['fixture']['id'],
+                'home_team_id' => $item['teams']['home']['id'],
+                'home_team_en' => $item['teams']['home']['name'],
+                'home_team'=>lang($item['teams']['home']['name']),
+                'home_team_logo' => $item['teams']['home']['logo'],
+                'guest_team_id' => $item['teams']['away']['id'],
+                'guest_team_en' => $item['teams']['away']['name'],
+                'guest_team'=>lang($item['teams']['away']['name']),
+                'guest_team_logo' => $item['teams']['away']['logo'],
+                'half_score' => "{$item['score']['halftime']['home']}-{$item['score']['halftime']['away']}",
+                'rbt' => $item['fixture']['timestamp'],
+                'score' => "{$item['goals']['home']}-{$item['goals']['away']}",
+                'league'=>lang($item['league']['name']),
+                'league_en' => $item['league']['name'],
+                'state' => $status[$item['fixture']['status']['short']],//比赛状态:0未开始1进行中2已完场3延期4取消
+                'game_time'=>$item['fixture']['timestamp'],
+            ];
+        }
+        Sport::insert($tableData);
+
+
+        return $tableData;
+    }
+}

+ 1 - 1
config/app.php

@@ -123,7 +123,7 @@
     |
     |
     */
     */
 
 
-    'locale' => env('APP_LOCALE', 'en'),
+    'locale' => env('APP_LOCALE', 'zh_CN'),
 
 
     'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
     'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
 
 

+ 4 - 38
resources/lang/en/message.php

@@ -6,42 +6,8 @@
     "英语" => "English",
     "英语" => "English",
     "日语" => "Japanese",
     "日语" => "Japanese",
     "韩语" => "Korean",
     "韩语" => "Korean",
-    "银行卡不存在" => "Bank card does not exist.",
-    "取款密码错误" => "Withdrawal password is incorrect.",
-    "余额不足" => "Insufficient balance.",
-    "数据不存在" => "Data does not exist",
-    "无需重复审核" => "No need for repeated review",
-    "参数错误" => "Parameter error",
-    "删除成功" => "Deleted successfully",
-    "设置成功" => "Settings saved successfully",
-    "操作失败" => "Operation failed",
-    "缺少参数" => "Missing parameters",
-    "有待处理订单,请先完成订单" => "There are pending orders, please complete them first",
-    "已经达到今日最大完单数,提升会员等级可增加每日完单数" => "Maximum daily order limit reached. Upgrade membership level to increase daily order limit",
-    "暂无适合的商品,请稍后再试" => "No suitable products available at the moment, please try again later",
-    "订单已生成,请尽快支付" => "Order has been generated, please pay as soon as possible",
-    "分配订单失败,请稍后再试" => "Failed to assign order, please try again later",
-    "未找到相关订单数据" => "No relevant order data found",
-    "订单已支付,请勿重复提交" => "Order has been paid, please do not submit again",
-    "钱包余额不足,请先充值" => "Insufficient wallet balance, please recharge first",
-    "刷单成功" => "Order brushing successful",
-    "验证失败" => "Verification failed",
-    "当前密码不正确" => "Current password is incorrect",
-    "密码修改成功" => "Password changed successfully",
-    "当前支付密码不正确" => "Current payment password is incorrect",
-    "支付密码修改成功" => "Payment password changed successfully",
-    "邀请码必填" => "Invitation code is required",
-    "邀请码无效" => "Invalid invitation code",
-    "同一IP登录用户过多,账号已被封禁" => "Too many users logging in from the same IP, account has been suspended",
-    "用户名不能为空" => "Username cannot be empty",
-    "密码不能为空" => "Password cannot be empty",
-    "用户名或密码错误" => "Incorrect username or password",
-    "用户被禁用,请联系管理员" => "User account has been disabled, please contact administrator",
-    "登录失败,请稍后重试" => "Login failed, please try again later",
-    "登录成功" => "Login successful",
-    "已经达到最大完单数,提升会员等级可增加完单数" => "The maximum number of completed orders has been reached. Upgrading the membership level can increase the number of completed orders.",
-    "当前账户余额不足,完成此订单还差{money},请先完成充值"=>"The current account balance is insufficient. There is still a shortfall of {money} to complete this order. Please complete the recharge first.",
-    "恭喜您,今日订单已完成!可在升级黄金会员后继续新一轮订单"=>"Congratulations! Your order for today has been completed! You can continue with a new round of orders after upgrading to Gold Membership.",
-    "恭喜您,今日订单已完成!可在升级钻石会员后继续新一轮订单"=>"Congratulations! Your order for today has been completed! You can continue with a new round of orders after upgrading to Diamond Membership.",
-    "请完成订单后申请提款" => "Please apply for withdrawal after completing the order",
+
+
+
+    'Liga Nacional' => 'Liga Nacional',
 ];
 ];

+ 5 - 38
resources/lang/zh_CN/message.php

@@ -6,44 +6,11 @@
     "英语" => "英语",
     "英语" => "英语",
     "日语" => "日语",
     "日语" => "日语",
     "韩语" => "韩语",
     "韩语" => "韩语",
-    "银行卡不存在" => "银行卡不存在",
-    "取款密码错误" => "取款密码错误",
-    "余额不足" => "余额不足",
-    "数据不存在" => "数据不存在",
-    "无需重复审核" => "无需重复审核",
-    "参数错误" => "参数错误",
-    "删除成功" => "删除成功",
-    "设置成功" => "设置成功",
-    "操作失败" => "操作失败",
-    "缺少参数" => "缺少参数",
-    "有待处理订单,请先完成订单" => "有待处理订单,请先完成订单",
-    "已经达到今日最大完单数,提升会员等级可增加每日完单数" => "已经达到今日最大完单数,提升会员等级可增加每日完单数",
-    "暂无适合的商品,请稍后再试" => "暂无适合的商品,请稍后再试",
-    "订单已生成,请尽快支付" => "订单已生成,请尽快支付",
-    "分配订单失败,请稍后再试" => "分配订单失败,请稍后再试",
-    "未找到相关订单数据" => "未找到相关订单数据",
-    "订单已支付,请勿重复提交" => "订单已支付,请勿重复提交",
-    "钱包余额不足,请先充值" => "钱包余额不足,请先充值",
-    "刷单成功" => "刷单成功",
-    "验证失败" => "验证失败",
-    "当前密码不正确" => "当前密码不正确",
-    "密码修改成功" => "密码修改成功",
-    "当前支付密码不正确" => "当前支付密码不正确",
-    "支付密码修改成功" => "支付密码修改成功",
-    "邀请码必填" => "邀请码必填",
-    "邀请码无效" => "邀请码无效",
-    "同一IP登录用户过多,账号已被封禁" => "同一IP登录用户过多,账号已被封禁",
-    "用户名不能为空" => "用户名不能为空",
-    "密码不能为空" => "密码不能为空",
-    "用户名或密码错误" => "用户名或密码错误",
-    "用户被禁用,请联系管理员" => "用户被禁用,请联系管理员",
-    "登录失败,请稍后重试" => "登录失败,请稍后重试",
-    "登录成功" => "登录成功",
-    "已经达到最大完单数,提升会员等级可增加完单数" => "已经达到最大完单数,提升会员等级可增加完单数",
-    "当前账户余额不足,完成此订单还差{money},请先完成充值"=>"当前账户余额不足,完成此订单还差{money},请先完成充值",
-    "恭喜您,今日订单已完成!可在升级黄金会员后继续新一轮订单"=>"恭喜您,今日订单已完成!可在升级黄金会员后继续新一轮订单",
-    "恭喜您,今日订单已完成!可在升级钻石会员后继续新一轮订单"=>"恭喜您,今日订单已完成!可在升级钻石会员后继续新一轮订单",
-    "请完成订单后申请提款" => "请完成订单后申请提款",
+
+    'Liga Profesional Argentina' => '阿根廷职业甲级联赛',
+    'Liga Nacional' => '危地马拉足球甲级联赛',
+    'Marquense' => '马昆森',
+    'Guastatoya' => '瓜斯塔托亚',
 
 
 ];
 ];