Explorar el Código

追加赛果接口

彭俊 hace 6 años
padre
commit
c9b57b434a

+ 186 - 0
app/Http/Controllers/Admin/SoccerNoteListController.php

@@ -59,6 +59,98 @@ class SoccerNoteListController extends Controller
         return view('sports/sports_notelist', $dt->render($request));
     }
 
+    //冠军注单手工结算
+    public function championset(Req $req)
+    {
+        $request['name_chinese'] = isset($req->name_chinese) ? trim($req->name_chinese) : null;
+        $request['sureblurs'] = isset($req->sureblurs) ? $req->sureblurs : 'on';
+        $request['account'] = isset($req->account) ? trim($req->account) : null;
+        $request['star_time'] = isset($req->star_time) ? trim($req->star_time) : null;
+        $request['end_time'] = isset($req->end_time) ? trim($req->end_time) : null;
+        $request['order_id'] = isset($req->order_id) ? trim($req->order_id) : null;
+        $request['match_id'] = isset($req->match_id) ? trim($req->match_id) : null;
+        $request['status'] = isset($req->status) ? trim($req->status) : '-1';
+        $request['order_status'] = isset($req->order_status) ? trim($req->order_status) : '-1';
+        $request['type'] = isset($req->type) ? trim($req->type) : 'zq';
+        $dt = \App\Lib\DataTable\DataTable::init();
+        $dt->setDataSource('/admin/SoccerNoteList/championsetinfo');
+        $dt->setLang('sportsnotelist');
+        //$dt->addColsFields('id', array('templet' => '#userdetail', 'sort' => true, 'width' => 80));
+        $dt->addColsFields('lg_id_order', array('sort' => true, 'width' => 200));
+        $dt->addColsFields('league', array('templet' => '#userdetail', 'sort' => false, 'width' => 100));
+        $dt->addColsFields('home_guest', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
+        $dt->addColsFields('content', array('templet' => '#userdetail', 'sort' => false, 'width' => 250));
+        $dt->addColsFields('money', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
+        $dt->addColsFields('water_return', array('templet' => '#userdetail', 'sort' => false, 'width' => 70));
+        $dt->addColsFields('prize_money', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
+        $dt->addColsFields('result', array('templet' => '#userdetail', 'sort' => false, 'width' => 70));
+        $dt->addColsFields('money_match_time', array('templet' => '#userdetail', 'sort' => false, 'width' => 200));
+        $dt->addColsFields('order_status', array('sort' => false, 'width' => 80));
+        $dt->addColsFields('account_money', array('templet' => '#userdetail', 'sort' => false, 'width' => 110));
+        $dt->addColsFields('game_status', array('templet' => '#game_status', 'sort' => false, 'width' => 90));
+        //$arr[] = 'view';
+//        if (checkRriv('/admin/SoccerNoteList/edit')) {
+//            $arr[] = 'edit';
+//        }
+//        $dt->setToolBar($arr, array('width' => 70));
+        $dt->enableCheckBox();//var_dump($request['type']);
+        return view('sports/sports_notelist', $dt->render($request));
+    }
+
+    function championsetinfo()
+    {
+        $page = Request::has('page') ? Request::get('page') : '';
+        $list = Request::has('limit') ? Request::get('limit') : 10;
+        $account = Request::get('account') ? Request::get('account') : '';
+        $star_time = Request::get('star_time') ? Request::get('star_time') . ' 00:00:00' : '';
+        $end_time = Request::get('end_time') ? Request::get('end_time') . ' 23:59:59' : '';
+        $order_id = Request::get('order_id') ? Request::get('order_id') : '';
+        $match_id = Request::get('match_id') ? Request::get('match_id') : '';
+        $status = Request::has('status') ? Request::get('status') : '-1';
+        $order_status = Request::has('order_status') ? Request::get('order_status') : '';
+        $sureblur = Request::has('sureblurs') ? Request::get('sureblurs') : 'off';
+        $type = Request::has('type') ? Request::get('type') : 'zq';
+        $where = array();
+        $where[] = array('money_buy_simplex.is_champion',1);
+        if (!empty($account)) {
+            if (empty($sureblur) || $sureblur == 'off') {
+                $where[] = array('money_buy_simplex.account_name', 'like', '%' . $account . '%');
+            } else {
+                $where[] = array('money_buy_simplex.account_name', '=', $account);
+            }
+        }
+        if (!empty($star_time)) {
+            if (!empty($end_time)) {
+                $where[] = array('money_buy_simplex.money_time', '>', $star_time);
+                $where[] = array('money_buy_simplex.money_time', '<', $end_time);
+            } else {
+                $where[] = array('money_buy_simplex.money_time', '>', $star_time);
+            }
+        } else if (empty($star_time)) {
+            if (!empty($end_time)) {
+
+                $where[] = array('money_buy_simplex.money_time', '<', $end_time);
+            }
+        }
+        if (!empty($order_id)) {
+            $where[] = array('money_buy_simplex.order_id', $order_id);
+        }
+        if (!empty($match_id)) {
+            $where[] = array('money_buy_simplex.match_id', $match_id);
+        }
+        if ($status != -1) {
+            $where[] = array('money_buy_simplex.settle_status', '=', $status);
+        }
+        if ($order_status != -1) {
+            $where[] = array('money_buy_simplex.status', '=', $order_status);
+        }
+        $where[] = array('money_buy_simplex.game_code', $type);
+        $newapp = new \App\Models\SportsNoteList();
+        $data = $newapp->info($list, $page, $where, $type);
+        //$alldata = Models\MoneyBuyMatch::where('bet_type',1)->where('is_rolling',1)->distinct('order_id')->count('order_id');
+        return \App\Lib\DataTable\DataTable::init()->toJson($data['data'], $data['total'], 0, $where);
+    }
+
     //修改冠军单订单结果
     function orderupgj(Req $req)
     {
@@ -157,6 +249,7 @@ class SoccerNoteListController extends Controller
         $sureblur = Request::has('sureblurs') ? Request::get('sureblurs') : 'off';
         $type = Request::has('type') ? Request::get('type') : 'zq';
         $where = array();
+        $where[] = array('money_buy_simplex.is_champion','<>',1);
         if (!empty($account)) {
             if (empty($sureblur) || $sureblur == 'off') {
                 $where[] = array('money_buy_simplex.account_name', 'like', '%' . $account . '%');
@@ -233,6 +326,98 @@ class SoccerNoteListController extends Controller
         return view('sports/sports_search', $dt->render($request));
     }
 
+    //冠军注单
+    public function champion(Req $req)
+    {
+        $request['name_chinese'] = isset($req->name_chinese) ? trim($req->name_chinese) : null;
+        $request['sureblurs'] = isset($req->sureblurs) ? $req->sureblurs : 'on';
+        $request['account'] = isset($req->account) ? trim($req->account) : null;
+        $request['star_time'] = isset($req->star_time) ? trim($req->star_time) : null;
+        $request['end_time'] = isset($req->end_time) ? trim($req->end_time) : null;
+        $request['order_id'] = isset($req->order_id) ? trim($req->order_id) : null;
+        $request['match_id'] = isset($req->match_id) ? trim($req->match_id) : null;
+        $request['status'] = isset($req->status) ? trim($req->status) : '-1';
+        $request['order_status'] = isset($req->order_status) ? trim($req->order_status) : '-1';
+        $request['type'] = isset($req->type) ? trim($req->type) : 'zq';
+        $dt = \App\Lib\DataTable\DataTable::init();
+        $dt->setDataSource('/admin/SoccerNoteList/championinfo');
+        $dt->setLang('sportsnotelist');
+        //$dt->addColsFields('id', array('templet' => '#userdetail', 'sort' => true, 'width' => 80));
+        $dt->addColsFields('lg_id_order', array('sort' => true, 'width' => 200));
+        $dt->addColsFields('league', array('templet' => '#userdetail', 'sort' => false, 'width' => 100));
+        $dt->addColsFields('home_guest', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
+        $dt->addColsFields('content', array('templet' => '#userdetail', 'sort' => false, 'width' => 250));
+        $dt->addColsFields('money', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
+        $dt->addColsFields('water_return', array('templet' => '#userdetail', 'sort' => false, 'width' => 70));
+        $dt->addColsFields('prize_money', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
+        $dt->addColsFields('result', array('templet' => '#userdetail', 'sort' => false, 'width' => 70));
+        $dt->addColsFields('money_match_time', array('templet' => '#userdetail', 'sort' => false, 'width' => 200));
+        $dt->addColsFields('order_status', array('sort' => false, 'width' => 80));
+        $dt->addColsFields('account_money', array('templet' => '#userdetail', 'sort' => false, 'width' => 110));
+        $dt->addColsFields('game_status', array('sort' => false, 'width' => 90));
+        //$arr[] = 'view';
+//        if (checkRriv('/admin/SoccerNoteList/edit')) {
+//            $arr[] = 'edit';
+//        }
+//        $dt->setToolBar($arr, array('width' => 70));
+        $dt->enableCheckBox();
+        return view('sports/sports_search', $dt->render($request));
+    }
+
+    function championinfo()
+    {
+        $page = Request::has('page') ? Request::get('page') : '';
+        $list = Request::has('limit') ? Request::get('limit') : 10;
+        $account = Request::get('account') ? Request::get('account') : '';
+        $star_time = Request::get('star_time') ? Request::get('star_time') . ' 00:00:00' : '';
+        $end_time = Request::get('end_time') ? Request::get('end_time') . ' 23:59:59' : '';
+        $order_id = Request::get('order_id') ? Request::get('order_id') : '';
+        $match_id = Request::get('match_id') ? Request::get('match_id') : '';
+        $status = Request::has('status') ? Request::get('status') : '';
+        $order_status = Request::has('order_status') ? Request::get('order_status') : '';
+        $sureblur = Request::has('sureblurs') ? Request::get('sureblurs') : 'off';
+        $type = Request::has('type') ? Request::get('type') : 'zq';
+        $where = array();
+        $where[] = array('money_buy_simplex.is_champion', 1);
+        if (!empty($account)) {
+            if (empty($sureblur) || $sureblur == 'off') {
+                $where[] = array('money_buy_simplex.account_name', 'like', '%' . $account . '%');
+            } else {
+                $where[] = array('money_buy_simplex.account_name', '=', $account);
+            }
+        }
+        if (!empty($star_time)) {
+            if (!empty($end_time)) {
+                $where[] = array('money_buy_simplex.money_time', '>', $star_time);
+                $where[] = array('money_buy_simplex.money_time', '<', $end_time);
+            } else {
+                $where[] = array('money_buy_simplex.money_time', '>', $star_time);
+            }
+        } else if (empty($star_time)) {
+            if (!empty($end_time)) {
+
+                $where[] = array('money_buy_simplex.money_time', '<', $end_time);
+            }
+        }
+        if (!empty($order_id)) {
+            $where[] = array('money_buy_simplex.order_id', $order_id);
+        }
+        if (!empty($match_id)) {
+            $where[] = array('money_buy_simplex.match_id', $match_id);
+        }
+        if ($status != -1) {
+            $where[] = array('money_buy_simplex.settle_status', '=', $status);
+        }
+        if ($order_status != -1) {
+            $where[] = array('money_buy_simplex.status', '=', $order_status);
+        }
+        $where[] = array('money_buy_simplex.game_code', $type);
+        $newapp = new \App\Models\SportsNoteList();
+        $data = $newapp->getinfo($list, $page, $where, $type);
+
+        return \App\Lib\DataTable\DataTable::init()->toJson($data['data'], $data['total'], 0, $where);
+    }
+
     //查询赛事结果
     // function Sairesult(Req $req){
     // $did = $req->did;
@@ -362,6 +547,7 @@ class SoccerNoteListController extends Controller
         $sureblur = Request::has('sureblurs') ? Request::get('sureblurs') : 'off';
         $type = Request::has('type') ? Request::get('type') : 'zq';
         $where = array();
+        $where[] = array('money_buy_simplex.is_champion','<>',1);
         if (!empty($account)) {
             if (empty($sureblur) || $sureblur == 'off') {
                 $where[] = array('money_buy_simplex.account_name', 'like', '%' . $account . '%');

+ 141 - 0
app/Http/Controllers/Api/WriteSportsController.php

@@ -85,6 +85,13 @@ class WriteSportsController extends BaseController
         return $ret;
     }
 
+    //写赛果接口
+    public function setResultExpress(Req $data)
+    {
+        $ret = $this->setResultExpress_v1($data);
+        return $ret;
+    }
+
     /*
      * 用户 用户 token
      */
@@ -2613,6 +2620,140 @@ class WriteSportsController extends BaseController
         }
     }
 
+
+    /**
+     * 写赛果数据
+     */
+    public function setResultExpress_v1($data){
+        //验证token
+        $user = new \App\Models\System_user;
+        if (empty($data->token)) return Response::generate('未获取到token', Response::TOKEN_ERR);
+        $token = $user::where(['token' => $data->token])->value('token');
+        if (empty($token)) return Response::generate('token验证不通过', Response::TOKEN_ERR);
+
+        try {
+            //开启事务
+            DB::beginTransaction();
+            $obt = $data->data;
+            //请求 数据 为空
+            if (empty($obt)) throw new \Exception(Response::generate('请求数据为空,', Response::ABNORMAL));
+            $getData = $this->getAddData($obt);
+
+            //不是 赛事 结果 记录 数据
+            if ($getData['title'] != 'result') throw new \Exception(Response::generate('不是赛果数据,', Response::ABNORMAL));
+
+            //获取球类代码
+            $game_code = $getData['game_code'];
+            //获取数据源
+            $source = $getData['source'];
+            //获取球类名称
+            $gameName = gameModel::getGameName($game_code);
+            //获取 model
+            $models = commonFunction::getModels($game_code, 1);
+            //获取 赛事 数据
+            $match_r_data = $getData['data'];
+
+            /*
+
+            //获取 当前请求 所有 uuid /match_id
+            $identity = [];//联赛uuid
+            $s_match_ids = [];//赛事id
+            $match_uuids = [];
+            foreach ($match_r_data as $k => $v) {
+                $identity[] = $v['uuid'];
+                $s_match_ids[] = $v['match_id'];
+            }
+
+            //====验证 赛事 所属 联赛 是否存在====
+            $identity = array_unique($identity);
+            sort($identity);
+
+            //获取 本地 已存在 联赛
+            $l_lg_data = $models['model_local_league']::whereIn('identity', $identity)->select('identity', 'lg_id')->get()->toArray();
+            //二维数组去重
+            $l_lg_data = commonFunction::uniquArrV2($l_lg_data, 'identity');
+            //循环对比 请求uuid->本地identity
+            foreach ($l_lg_data as $k => $v) {
+                foreach ($identity as $kk => $uuid) {
+                    if ($v['identity'] == $uuid) {
+                        unset($identity[$kk]);
+                    }
+                }
+            }
+            sort($identity);
+            //去除本地和请求里都存在的联赛,如果还有剩余联赛id,则返回异常
+            if (!empty($identity)) throw new \Exception(Response::generate($gameName . '联赛:uuid-' . $identity[0] . ';', Response::LEAGUE_ERROR));
+            //====end====
+
+            //====验证 赛事结果记录 所属赛事 是否存在====$match_uuids
+            $s_match_ids = array_unique($s_match_ids);
+            sort($s_match_ids);
+
+            //获取 本地 已存在 赛事
+            $l_match_data = $models['model_local_match']::whereIn('others_match_id', $s_match_ids)->where('source', $source)->select('others_match_id', 'match_id')->get()->toArray();
+
+            //二维数组去重
+            $l_match_data = commonFunction::uniquArrV2($l_match_data, 'others_match_id');
+
+            //循环对比 请求match_id->本地others_match_id 
+            foreach ($l_match_data as $k => $v) {
+                foreach ($s_match_ids as $kk => $s_match_id) {
+                    if ($v['others_match_id'] == $s_match_id) {
+                        unset($s_match_ids[$kk]);
+                    }
+                }
+            }
+            sort($s_match_ids);
+            //去除本地和请求里都存在的赛事,如果还有剩余赛事id,则返回异常
+            if (!empty($s_match_ids)) throw new \Exception(Response::generate($gameName . '赛事-match_id' . $s_match_ids[0] . ';', Response::MATCH_ERROR));
+            //====end====
+
+            //处理 赛事 结果记录 数据
+            foreach ($match_r_data as $k => $v) {
+                $data = $v;
+                //获取 本地 联赛 ID
+                $lg_id = commonFunction::searcharray($data['uuid'], 'identity', $l_lg_data, 'lg_id');
+                //获取 本地 赛事 ID
+                $match_id = commonFunction::searcharray($data['match_id'], 'others_match_id', $l_match_data, 'match_id');
+
+                //根据球类 获取 赛事结果记录字段
+                $set_match_r = $this->get_match_r($game_code, $lg_id, $match_id, $data);
+
+                //写 赛事 结果 记录
+                $ret = $models['model_result_record']::insert($set_match_r);
+
+                if ($ret != true) throw new \Exception(Response::generate($gameName . '赛事-match_id:' . $data['match_id'] . ';', Response::ADD_MATCH_R_R_ERROR));
+            }
+            */
+            if(!empty($match_r_data)){
+                foreach($match_r_data as $k=>$v){
+                    $v['c_time'] = date('Y-m-d H:i:s',time());
+                    $v['u_time'] = date('Y-m-d H:i:s',time());
+                    $v['source'] = $source;
+                    $v['play_data'] = json_encode($v['play_data']);
+
+                    $ret = $models['model_result_express']::insert($v);
+                    if ($ret != true) throw new \Exception(Response::generate($gameName . ';', Response::SET_MATCH_R_ERR));
+                }
+               
+                //写 赛事 结果 记录
+            }
+
+            //提交事务
+            DB::commit();
+            //写请求数据 日志记录
+            if ($this->isRecord) commonFunction::SET_SPORTS_RECORD($game_code, $getData, $getData['title'], Response::success());
+            return Response::success();
+        } catch (\Exception $e) {
+            //回滚事务
+            DB::rollBack();
+            //写请求数据 日志记录
+            if ($this->isRecord) commonFunction::SET_SPORTS_RECORD($game_code, $getData, $getData['title'], $e->getMessage());
+            return $e->getMessage();
+        }
+
+    }
+
     /**
      * @param $data
      * @return mixed

+ 1 - 0
app/Http/Middleware/VerifyCsrfToken.php

@@ -22,6 +22,7 @@ class VerifyCsrfToken extends Middleware
         'setMatchResult',
         'setBroadCast',
         'getArea',
+        'setResultExpress',
         //'upImg',
         //
     ];

+ 16 - 0
app/Http/Model/StBqResultExpress.php

@@ -0,0 +1,16 @@
+<?php
+namespace App\Http\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * Class Account
+ * @package App\Sports\Model
+ * 用户账号
+ */
+class StBqResultExpress extends Model
+{
+    protected $table = 'st_bq_result_express';
+    public $timestamps = false;
+
+}

+ 16 - 0
app/Http/Model/StLqResultExpress.php

@@ -0,0 +1,16 @@
+<?php
+namespace App\Http\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * Class Account
+ * @package App\Sports\Model
+ * 用户账号
+ */
+class StLqResultExpress extends Model
+{
+    protected $table = 'st_lq_result_express';
+    public $timestamps = false;
+
+}

+ 16 - 0
app/Http/Model/StWqResultExpress.php

@@ -0,0 +1,16 @@
+<?php
+namespace App\Http\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * Class Account
+ * @package App\Sports\Model
+ * 用户账号
+ */
+class StWqResultExpress extends Model
+{
+    protected $table = 'st_wq_result_express';
+    public $timestamps = false;
+
+}

+ 16 - 0
app/Http/Model/StZqResultExpress.php

@@ -0,0 +1,16 @@
+<?php
+namespace App\Http\Model;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * Class Account
+ * @package App\Sports\Model
+ * 用户账号
+ */
+class StZqResultExpress extends Model
+{
+    protected $table = 'st_zq_result_express';
+    public $timestamps = false;
+
+}

+ 7 - 0
app/Http/Response/Response.php

@@ -59,6 +59,10 @@ class Response
     //===写预植赛果失败===
     const SET_MATCH_ERR = 10042;
 
+    //===写赛果失败===
+    const SET_MATCH_R_ERR = 10043;
+
+
 
     private static $errorMsgs = [
         self::SUCCESS => '成功',
@@ -110,6 +114,9 @@ class Response
         //===写预植赛果失败===
         self::SET_MATCH_ERR =>'写预植赛果失败',
 
+        //===写赛果失败===
+        self::SET_MATCH_R_ERR =>'写赛果失败',
+
     ];
 
     public static function getMsg($code)

+ 15 - 1
app/Lib/Biz/Sport/Common.php

@@ -15,6 +15,8 @@ use App\Http\Model\StZqOddsRecord;
 use App\Http\Model\StZqResult;
 use App\Http\Model\StZqResultRecord;
 use App\Http\Model\StZqBroadcast;
+use App\Http\Model\StZqResultExpress;
+
 
 use App\Http\Model\StLqMatch;
 use App\Http\Model\StLqLeague;
@@ -26,6 +28,8 @@ use App\Http\Model\StLqOddsRecord;
 use App\Http\Model\StLqResult;
 use App\Http\Model\StLqResultRecord;
 use App\Http\Model\StLqBroadcast;
+use App\Http\Model\StLqResultExpress;
+
 
 use App\Http\Model\StWqResultRecord;
 use App\Http\Model\StWqMatch;
@@ -37,6 +41,8 @@ use App\Http\Model\StWqOdds;
 use App\Http\Model\StWqOddsRecord;
 use App\Http\Model\StWqResult;
 use App\Http\Model\StWqBroadcast;
+use App\Http\Model\StWqResultExpress;
+
 
 use App\Http\Model\StBqResultRecord;
 use App\Http\Model\StBqMatch;
@@ -48,6 +54,8 @@ use App\Http\Model\StBqOdds;
 use App\Http\Model\StBqOddsRecord;
 use App\Http\Model\StBqResult;
 use App\Http\Model\StBqBroadcast;
+use App\Http\Model\StBqResultExpress;
+
 
 class Common
 {
@@ -712,6 +720,8 @@ class Common
                     $model_local_league = new StZqLocalLeague;
                     $model_local_match = new StZqLocalMatch;
                     $model_broadcast = new StZqBroadcast;
+                    $model_result_express = new StZqResultExpress;
+                    
                     break;
                 case 'lq':
                     $model_league = new StLqLeague;
@@ -724,6 +734,7 @@ class Common
                     $model_local_league = new StLqLocalLeague;
                     $model_local_match = new StLqLocalMatch;
                     $model_broadcast = new StLqBroadcast;
+                    $model_result_express = new StLqResultExpress;
                     break;
                 case 'wq':
                     $model_league = new StWqLeague;
@@ -736,6 +747,7 @@ class Common
                     $model_local_league = new StWqLocalLeague;
                     $model_local_match = new StWqLocalMatch;
                     $model_broadcast = new StWqBroadcast;
+                    $model_result_express = new StWqResultExpress;
                     break;
                 case 'bq':
                     $model_league = new StBqLeague;
@@ -748,6 +760,7 @@ class Common
                     $model_local_league = new StBqLocalLeague;
                     $model_local_match = new StBqLocalMatch;
                     $model_broadcast = new StBqBroadcast;
+                    $model_result_express = new StBqResultExpress;
                     break;
                 default:
                     throw new \Exception(Response::generate(Response::ABNORMAL));
@@ -763,7 +776,8 @@ class Common
             'model_league_result' => $model_league_result,//联赛结果
             'model_local_league' => $model_local_league,//本地关联联赛
             'model_local_match' => $model_local_match,//本地关联赛事
-            'model_broadcast' => $model_broadcast,
+            'model_broadcast' => $model_broadcast, //直播数据接口
+            'model_result_express' => $model_result_express,//赛果数据
         ];
         return $data;
     }

+ 31 - 27
app/Models/SportsNoteList.php

@@ -94,26 +94,27 @@ class SportsNoteList extends BaseModel
                 $data[$i]->game_status = '已处理';
             }
 
-            if ($data[$i]->game_code == 'zq') {
-                $data[$i]->match_id_order = '<a href="/admin/sportsfoot/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
-            }
-            if ($data[$i]->game_code == 'lq') {
-                $data[$i]->match_id_order = '<a href="/admin/Sportsbk/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
-            }
-            if ($data[$i]->game_code == 'wq') {
-                $data[$i]->match_id_order = '<a href="/admin/Sportswq/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
-            }
-            if ($data[$i]->game_code == 'bq') {
-                $data[$i]->match_id_order = '<a href="/admin/Sportsbq/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
-            }
-
             $data[$i]->league = $data[$i]->name_chinese;
 
-
             if ($data[$i]->is_champion == 0) {
+                if ($data[$i]->game_code == 'zq') {
+                    $data[$i]->match_id_order = '<a href="/admin/sportsfoot/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
+                }
+                if ($data[$i]->game_code == 'lq') {
+                    $data[$i]->match_id_order = '<a href="/admin/Sportsbk/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
+                }
+                if ($data[$i]->game_code == 'wq') {
+                    $data[$i]->match_id_order = '<a href="/admin/Sportswq/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
+                }
+                if ($data[$i]->game_code == 'bq') {
+                    $data[$i]->match_id_order = '<a href="/admin/Sportsbq/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
+                }
+
                 $data[$i]->home_guest = $data[$i]->home_team . ' VS ' . $data[$i]->guest_team;
                 $data[$i]->time = '开赛:' . $data[$i]->match_date . ' ' . $data[$i]->match_time;
             } else {
+                $data[$i]->lg_id_order = $data[$i]->match_id . '(<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
+
                 $data[$i]->home_guest = '冠军联赛投注';
                 $data[$i]->time = '结束:' . $data[$i]->last_time;
 
@@ -420,25 +421,28 @@ class SportsNoteList extends BaseModel
                 $data[$i]->game_status = '已处理';
             }
 
-            if ($data[$i]->game_code == 'zq') {
-                $data[$i]->match_id_order = '<a href="/admin/sportsfoot/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
-            }
-            if ($data[$i]->game_code == 'lq') {
-                $data[$i]->match_id_order = '<a href="/admin/Sportsbk/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
-            }
-            if ($data[$i]->game_code == 'wq') {
-                $data[$i]->match_id_order = '<a href="/admin/Sportswq/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
-            }
-            if ($data[$i]->game_code == 'bq') {
-                $data[$i]->match_id_order = '<a href="/admin/Sportsbq/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
-            }
-
             $data[$i]->league = $data[$i]->name_chinese;
 
             if ($data[$i]->is_champion == 0) {
+                if ($data[$i]->game_code == 'zq') {
+                    $data[$i]->match_id_order = '<a href="/admin/sportsfoot/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
+                }
+                if ($data[$i]->game_code == 'lq') {
+                    $data[$i]->match_id_order = '<a href="/admin/Sportsbk/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
+                }
+                if ($data[$i]->game_code == 'wq') {
+                    $data[$i]->match_id_order = '<a href="/admin/Sportswq/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
+                }
+                if ($data[$i]->game_code == 'bq') {
+                    $data[$i]->match_id_order = '<a href="/admin/Sportsbq/outcome?home_team=' . $data[$i]->match_id . '">' . $data[$i]->match_id . '</a> (<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
+                }
+
                 $data[$i]->home_guest = $data[$i]->home_team . ' VS ' . $data[$i]->guest_team;
                 $data[$i]->time = '开赛:' . $data[$i]->match_date . ' ' . $data[$i]->match_time;
+
             } else {
+                $data[$i]->lg_id_order = $data[$i]->match_id . '(<span>' . $data[$i]->account_name . '</span>)<br>' . $data[$i]->order_id;
+
                 $data[$i]->home_guest = '冠军联赛投注';
                 $data[$i]->time = '结束:' . $data[$i]->last_time;
 

+ 1 - 0
resources/lang/zh-cn/sportsnotelist.php

@@ -7,6 +7,7 @@ return array(
     'account_name' => '投注用户',
     'order_time' => '订单号/下注时间',
     'match_id_order' => '赛事id/订单号',
+    'lg_id_order' => '联赛id/订单号',
     'game' => '游戏名称',
     'league' => '联赛名',
     'money_match_time' => '下注/开赛时间',

+ 4 - 0
routes/web.php

@@ -60,6 +60,10 @@ Route::post('/setMatchResult', function () {
 Route::post('/setBroadCast', function () {
     return appExec('api', 'WriteSports', 'setBroadCast');
 });
+//写入赛果数据
+Route::post('/setResultExpress', function () {
+    return appExec('api', 'WriteSports', 'setResultExpress');
+});
 //获取联赛所属国家地区
 Route::post('/getArea', function () {
     return appExec('api', 'WriteSports', 'getArea');