Browse Source

异常处理

彭俊 6 years ago
parent
commit
2014fb51d3

+ 103 - 1
app/Http/Controllers/Admin/SoccerNoteListController.php

@@ -1000,7 +1000,109 @@ class SoccerNoteListController extends Controller
             $buyModel->result_flag = 1;
             $buyModel->is_manual = 1;
             $ret = $buyModel->save();
-            
+
+            if ($ret) {
+                $ret2 = $this->do_win_set($order_id, $game_code, $match_id);
+                if ($ret2['status'] == 1) {
+                    return responseToJson(1, '操作成功!');
+                } else {
+                    return responseToJson(0, '操作失败2!--' . $ret2['data']);
+                }
+            }
+            return responseToJson(0, '更新失败1');
+        }
+
+        if ($game_code == 'lq') {
+            $home = $pdatas['home'];
+            $guest = $pdatas['guest'];
+
+            $restModel->home_score = ['1' => intval($home['0']), '2' => intval($home['1']), '3' => intval($home['2']), '4' => intval($home['3'])];
+            $restModel->guest_score = ['1' => intval($guest['0']), '2' => intval($guest['1']), '3' => intval($guest['2']), '4' => intval($guest['3'])];
+            $restModel->u_home_score = intval($home['0']) + intval($home['1']);
+            $restModel->u_guest_score = intval($guest['0']) + intval($guest['1']);
+
+            $all_home = intval($home['0']) + intval($home['1']) + intval($home['2']) + intval($home['3']);
+            $all_guest = intval($guest['0']) + intval($guest['1']) + intval($guest['2']) + intval($guest['3']);
+            $restModel->all_goal = $all_home + $all_guest;
+            $restModel->match_score = $all_home . ':' . $all_guest;
+            $restModel->match_winer = $all_home > $all_guest ? $restModel->home_team : $restModel->guest_team;
+            $restModel->warn_more = json_decode($restModel->warn_more, 256);
+
+            $buyModel->single_result = json_encode([$restModel], 256);
+            $buyModel->result_flag = 1;
+            $buyModel->is_manual = 1;
+            $ret = $buyModel->save();
+
+            if ($ret) {
+                $ret2 = $this->do_win_set($order_id, $game_code, $match_id);
+                if ($ret2['status'] == 1) {
+                    return responseToJson(1, '操作成功!');
+                } else {
+                    return responseToJson(0, '操作失败2!--' . $ret2['data']);
+                }
+            }
+            return responseToJson(0, '更新失败1');
+        }
+
+        if ($game_code == 'bq') {
+            $home = $pdatas['home'];
+            $guest = $pdatas['guest'];
+            $home_other = $pdatas['home_other'];
+            $guest_other = $pdatas['guest_other'];
+
+            $arrs = [];
+            for ($i = 0; $i <= 8; $i++) {
+                $j = $i + 1;
+                $arrs[$j] = [
+                    'home' => intval($home[$i]),
+                    'guest' => intval($guest[$i]),
+                ];
+            }
+            $arrs['other'] = [
+                'home' => intval($home_other),
+                'guest' => intval($guest_other),
+            ];
+
+            $restModel->match_score_t = $arrs;
+            $restModel->warn_more = json_decode($restModel->warn_more, 256);
+
+            $buyModel->single_result = json_encode([$restModel], 256);
+            $buyModel->result_flag = 1;
+            $buyModel->is_manual = 1;
+            $ret = $buyModel->save();
+
+            if ($ret) {
+                $ret2 = $this->do_win_set($order_id, $game_code, $match_id);
+                if ($ret2['status'] == 1) {
+                    return responseToJson(1, '操作成功!');
+                } else {
+                    return responseToJson(0, '操作失败2!--' . $ret2['data']);
+                }
+            }
+            return responseToJson(0, '更新失败1');
+        }
+
+        if ($game_code == 'wq') {
+            $home = $pdatas['home'];
+            $guest = $pdatas['guest'];
+
+            $arrs = [];
+            for ($i = 0; $i <= 4; $i++) {
+                $j = $i + 1;
+                $arrs[$j] = [
+                    'home' => intval($home[$i]),
+                    'guest' => intval($guest[$i]),
+                ];
+            }
+
+            $restModel->inning = $arrs;
+            $restModel->warn_more = json_decode($restModel->warn_more, 256);
+
+            $buyModel->single_result = json_encode([$restModel], 256);
+            $buyModel->result_flag = 1;
+            $buyModel->is_manual = 1;
+            $ret = $buyModel->save();
+
             if ($ret) {
                 $ret2 = $this->do_win_set($order_id, $game_code, $match_id);
                 if ($ret2['status'] == 1) {

+ 4 - 3
app/Http/Controllers/Api/SettlementController.php

@@ -47,16 +47,17 @@ class SettlementController extends Controller
     public function debug(Req $req)
     {
 
-        /*
+
         $model = new ComendnoticeModel();
         $need = $model->getNeedSettelent() ;
         var_dump($need);
         exit ;
-        */
+
 
 
         $auto = new SettlementAuto();
-        $auto->doAutoSett();
+        $ret =$auto->doAutoSett('oclatv15689731035d84a12f550df');
+        var_dump($ret);
         //return;
         //print_r($_SERVER);
         exit;

+ 27 - 1
app/Http/Controllers/Api/WriteSportsController.php

@@ -52,7 +52,7 @@ class WriteSportsController extends BaseController
     //写赛事
     public function setMatch(Req $data)
     {
-        $ret = $this->setMatch_v1($data);
+        $ret = $this->setMatch_v2($data);
         return $ret;
     }
 
@@ -293,6 +293,7 @@ class WriteSportsController extends BaseController
     /*
      * 写 赛事 数据
      * 每个请求 包含 N个联赛 下 N个赛事
+     * 新增合并赛事 追加赛事uuid字段
      */
     public function setMatch_v2($data)
     {
@@ -2753,6 +2754,31 @@ class WriteSportsController extends BaseController
         }
     }
 
+    /**
+     * 定时执行 滚球投注危险球审核
+     */
+    public function HandleOrder(){
+        try {
+            //开启事务
+            DB::beginTransaction();
+            $time = 60;
+            //处理指定时间内的滚球待审核订单
+            SportsNoteListModel::getOrderData($time);
+            //提交事务
+            DB::commit();
+            //写请求数据 日志记录
+            if ($this->isRecord) commonFunction::SET_SPORTS_RECORD('zq', [], 'HandleOrder', Response::success());
+            return Response::success();
+        } catch (\Exception $e) {
+            //回滚事务
+            DB::rollBack();
+            //写请求数据 日志记录
+            if ($this->isRecord) commonFunction::SET_SPORTS_RECORD('zq', [], 'HandleOrder', $e->getMessage());
+            return $e->getMessage();
+        }
+
+    }
+
     /**
      * @param $data
      * @return mixed

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

@@ -24,6 +24,7 @@ class VerifyCsrfToken extends Middleware
         'getArea',
         'setResultExpress',
         'setMatchWarn',
+        'HandleOrder',
         //'upImg',
         //
     ];

+ 79 - 0
app/Models/SportsNoteList.php

@@ -9,8 +9,11 @@
 namespace App\Models;
 
 use Illuminate\Support\Facades\DB;
+use App\Lib\Biz\Sport\Common as commonFunction;
 use App\Models\MoneyBuyMatchb;
 use App\Http\Response\Response;
+use App\Http\Model\StZqResult;
+
 
 class SportsNoteList extends BaseModel
 {
@@ -1011,6 +1014,82 @@ class SportsNoteList extends BaseModel
         }
     }
 
+    /**
+     * 滚球投注 获取指定时间内未审核订单
+     */
+    public static function getOrderData($time=60){
+
+        //获取需查询 时间条件 时间戳
+        $time_unx = time()-$time;
+
+        //拼接查询条件
+        $where = [
+            ['money_time','>',date('Y-m-d H:i:s',$time_unx)],
+            ['roll_ratify','=',2]
+        ];
+        //获取 待处理订单数据
+        $order_data = self::where($where)->SELECT('id','match_id','account_name','account_identity','order_id','money_time','roll_ratify','money','gain_money')->get()->toArray();
+        if(!empty($order_data)){
+            $db = new \App\Models\Setinfo();
+            //获取设定需审核时间 秒
+            $handle_time =  $db->getInfo(1003)['infocontent']?:90;
+            //获取订单所属赛事id
+            $match_ids = [];
+            foreach($order_data as $k=>$v){
+                $match_ids[] = $v['match_id'];
+            }
+
+            //去重 获取赛事危险球数据
+            $warn_json_data = StZqResult::whereIn('match_id',$match_ids)->SELECT('match_id','warn_more')->get()->toArray();
+
+            //获取审核不通过订单 订单号
+            $order_ids_n = [];
+            //获取审核不通过订单
+            $order_data_n = [];
+            //获取审核通过订单 订单号
+            $order_ids_y = [];
+            //获取审核未通过订单 投注人
+            $account_identitys = [];
+            foreach($order_data as $k=>$v){
+                //获取每个订单的危险球数据
+                $warn_data = commonFunction::filter_by_value($warn_json_data,'match_id',$v['match_id']);
+                $warn_data_arr = json_decode($warn_data['warn_more'],true);
+                //投注时间 时间戳
+                $order_time = strtotime($v['money_time']);
+                foreach($warn_data_arr as $kk=>$vv){
+                    //危险球时间 时间戳
+                    $warn_time = strtotime($vv['timei']);
+                    if($order_time < $warn_time and ($order_time+$handle_time) > $warn_time){
+                        $order_ids_n[] = $v['order_id'];
+                        $account_identitys[] = $v['account_identity'];
+                        $order_data_n[] = $v;
+                        unset($order_data[$k]);
+                    }
+                }
+            }
+
+            if(!empty($order_data)){
+                foreach($order_data as $k=>$v){
+                    $order_ids_y[] = $v['order_id'];
+                }
+            }
+
+            if(!empty($order_ids_n)){
+                //在审核时间内订单 审核不通过
+                self::HandleMoney_v2($account_identitys,$order_ids_n,$order_data_n);
+            }
+            if(!empty($order_ids_y)){
+                //在审核时间外订单 审核通过
+                $ret_y = self::whereIn('order_id', $order_ids_y)->update(['roll_ratify' => 1,'use_mark'=>'滚球投注自动审核(危险球)通过']);
+                //如果更新数量小于订单数量 则返回异常
+                if($ret_y < count($order_ids_y))  throw new \Exception( Response::generate('',Response::HANDLE_ORDER_Y_ERR));
+
+            }
+
+        }
+      
+    }
+
     /**
      * 滚球自动审核 账户资金处理
      * v1 

+ 208 - 35
resources/views/sports/sports_notelist.blade.php

@@ -414,7 +414,7 @@
         function setScore_v2(order_id, match_id, game_code) {
             $.getJSON("/admin/SoccerNoteList/manualmatchget_v2", {'order_id': order_id}, function (res) {
                 if (1 == res.status) {
-                    console.log(res);
+                    //console.log(res);
                     switch (game_code) {
                         case 'zq':
                             setScore_v2_zq(res.data.order, res.data.result,order_id, match_id, game_code);
@@ -438,20 +438,18 @@
         function setScore_v2_zq(orderObj, resultObj,order_id,match_id,game_code) {
             let content = '<div style="width: 100%;height:25px;"></div><div class="layui-form-item">' +
                 '  <div class="layui-inline">' +
-                '    <label class="layui-form-label">进球数:</label>' +
-                '    <label class="layui-form-label">上半场</label>' +
+                '    <label class="layui-form-label" style="width:60px;">进球数:</label>' +
+                '    <label class="layui-form-label"  style="width:100px;">上半场[主/客]</label>' +
                 '    <div class="layui-input-inline" style="width: 50px;">' +
                 '      <input type="text" name="set_zq_home_score" id="set_zq_home_score_u" placeholder="主"  value="' + resultObj.u_home_score +'"  required   autocomplete="off" class="layui-input">' +
                 '    </div>' +
-                '    <div class="layui-form-mid"></div>' +
                 '    <div class="layui-input-inline" style="width: 50px;">' +
                 '      <input type="text" name="set_zq_guest_score"  id="set_zq_guest_score_u"  placeholder="客"  value="' + resultObj.u_guest_score +'"   required   autocomplete="off" class="layui-input">' +
                 '    </div>' +
-                '    <label class="layui-form-label">全场</label>' +
+                '    <label class="layui-form-label"  style="width:100px;">全场[主/客]</label>' +
                 '    <div class="layui-input-inline" style="width: 50px;">' +
                 '      <input type="text" name="set_zq_home_score" id="set_zq_home_score" placeholder="主"  value="' + resultObj.home_score +'"   required   autocomplete="off" class="layui-input">' +
                 '    </div>' +
-                '    <div class="layui-form-mid"></div>' +
                 '    <div class="layui-input-inline" style="width: 50px;">' +
                 '      <input type="text" name="set_zq_guest_score"  id="set_zq_guest_score"  placeholder="客"   value="' + resultObj.guest_score +'"     required   autocomplete="off" class="layui-input">' +
                 '    </div>' +
@@ -459,7 +457,7 @@
                 '</div>';
 
             layer.open({
-                area: ['600px', '250px'], //宽高
+                area: ['700px', '200px'], //宽高
                 type: 1,
                 title: '设置比分',
                 content: content, //这里content是一个DOM,注意:最好该元素要存放在body最外层,否则可能被其它的相对元素所影响,
@@ -472,47 +470,222 @@
                             guest_u: $("#set_zq_guest_score_u").val(),
                         });
 
-                    // 请求设置接口
-                    $.ajax({
-                        type: 'POST',
-                        dataType: 'json',
-                        url: '/admin/SoccerNoteList/manualmatchpdate_v2',
-                        data: {order_id: order_id, game_code: game_code, match_id: match_id, matchdata: matchdata},
-                        success: function (res) {
-                            if (1 == res.status) {
-                                layer.alert("设置成功", {title: '友情提示', icon: 1, closeBtn: 0}, function () {
-                                    window.location.reload();
-                                });
-                            } else {
-                                layer.alert("服务器异常(0)", {title: '友情提示', icon: 2});
-                            }
-                        },
-                        error: function () {
-                            layer.alert("服务器异常(1)", {title: '友情提示', icon: 2});
-                        }
-                    })
+                    ajax_setScore_all_v2(order_id,game_code,match_id,matchdata);
+                    return true;
+                },
+            });
+        }
+
+        function setScore_v2_lq(orderObj, resultObj,order_id,match_id,game_code) {
+            let home = JSON.parse(resultObj.home_score);
+            let guest = JSON.parse(resultObj.guest_score);
 
+            let content = '<div style="width: 100%;height:25px;"></div><div class="layui-form-item">' +
+                '  <div class="layui-inline">' +
+                '    <label class="layui-form-label" style="width: 100px;">主队各场球数:</label>' +
+                '    <div class="layui-input-inline" style="width: 35px;">' +
+                '      <input type="text" name="set_lq_home_score_1" id="set_lq_home_score_1" value="' + home[1] + '"  required   autocomplete="off" class="layui-input">' +
+                '    </div>' +
+                '    <div class="layui-input-inline" style="width: 35px;">' +
+                '      <input type="text" name="set_lq_home_score_2"  id="set_lq_home_score_2"   value="' + home[2] + '"   required   autocomplete="off" class="layui-input">' +
+                '    </div>' +
+                '    <div class="layui-input-inline" style="width: 35px;">' +
+                '      <input type="text" name="set_lq_home_score_3" id="set_lq_home_score_3"  value="' + home[3] + '"   required   autocomplete="off" class="layui-input">' +
+                '    </div>' +
+                '    <div class="layui-input-inline" style="width: 35px;">' +
+                '      <input type="text" name="set_lq_home_score_4"  id="set_lq_home_score_4"  value="' + home[4] + '"     required   autocomplete="off" class="layui-input">' +
+                '    </div>' +
+                '  </div>' +
+                '  <div class="layui-inline">' +
+                '    <label class="layui-form-label" style="width: 100px;">客队各场球数:</label>' +
+                '    <div class="layui-input-inline" style="width: 35px;">' +
+                '      <input type="text" name="set_lq_gueste_score_1" id="set_lq_gueste_score_1"  value="' + guest[1] + '"  required   autocomplete="off" class="layui-input">' +
+                '    </div>' +
+                '    <div class="layui-input-inline" style="width: 35px;">' +
+                '      <input type="text" name="set_lq_gueste_score_2"  id="set_lq_gueste_score_2"    value="' + guest[2] + '"   required   autocomplete="off" class="layui-input">' +
+                '    </div>' +
+                '    <div class="layui-input-inline" style="width: 35px;">' +
+                '      <input type="text" name="set_lq_gueste_score_3" id="set_lq_gueste_score_3"  value="' + guest[3] + '"   required   autocomplete="off" class="layui-input">' +
+                '    </div>' +
+                '    <div class="layui-input-inline" style="width: 35px;">' +
+                '      <input type="text" name="set_lq_gueste_score_4"  id="set_lq_gueste_score_4"   value="' + guest[4] + '"     required   autocomplete="off" class="layui-input">' +
+                '    </div>' +
+                '  </div>' +
+                '</div>';
 
+            layer.open({
+                area: ['800px', '200px'], //宽高
+                type: 1,
+                title: '设置比分',
+                content: content, //这里content是一个DOM,注意:最好该元素要存放在body最外层,否则可能被其它的相对元素所影响,
+                btn: ['提交', '取消'],
+                yes: function (index, layero) {
+                    matchdata = JSON.stringify({
+                        'home': [$("#set_lq_home_score_1").val(), $("#set_lq_home_score_2").val(), $("#set_lq_home_score_3").val(), $("#set_lq_home_score_4").val(),],
+                        'guest': [$("#set_lq_gueste_score_1").val(), $("#set_lq_gueste_score_2").val(), $("#set_lq_gueste_score_3").val(), $("#set_lq_gueste_score_4").val(),],
+                    });
+
+                    // 请求设置接口
+                    ajax_setScore_all_v2(order_id,game_code,match_id,matchdata);
                     return true;
                 },
             });
-        }
 
-        function setScore_v2_lq($orderObj, $resultObj) {
-            layer.msg('还未定怎么做,等等.....');
-            return ;
+            return;
         }
 
-        function setScore_v2_bq($orderObj, $resultObj) {
-            layer.msg('还未定怎么做,等等.....');
+
+        function setScore_v2_bq(orderObj, resultObj,order_id,match_id,game_code) {
+            let match_score = JSON.parse(resultObj.match_score_t);
+
+            let content = '<div style="width: 100%;height:25px;"></div><div class="layui-form-item">' +
+                '  <div class="layui-inline">' +
+                '    <label class="layui-form-label" style="width: 100px;">主队各局得分:</label>' ;
+
+                 tmp = '' ;
+                 for (let i=1;i<=9;i++){
+                     tmp +=   '<div class="layui-input-inline" style="width: 30px;">' +
+                         '      <input type="text" name="set_bq_home_score_'+i+'" id="set_bq_home_score_'+i+'" value="' + match_score[i]['home'] + '"  required   autocomplete="off" class="layui-input">' +
+                         '    </div>';
+                     }
+                content = content + tmp ;
+                content +=  '  </div>' +
+                    '  <div class="layui-inline">' +
+                    '    <label class="layui-form-label" style="width: 100px;">客队各局得分:</label>' ;
+                    tmp = '' ;
+                    for (let i=1;i<=9;i++){
+                        tmp +=     '    <div class="layui-input-inline" style="width: 30px;">' +
+                            '      <input type="text" name="set_bq_gueste_score_'+i+'" id="set_bq_guest_score_'+i+'"  value="' +  + match_score[i]['guest']  + '"  required   autocomplete="off" class="layui-input">' +
+                            '    </div>' ;
+                    }
+                content = content + tmp ;
+                content +=  '  </div>' ;
+                content +=     '</div>';
+                content +=   '  <div class="layui-inline">' +
+                    '    <label class="layui-form-label" style="width: 130px;">加试赛得分[主/客]:</label>' +
+                    '    <div class="layui-input-inline" style="width: 35px;">' +
+                    '      <input type="text" name="set_bq_home_score_ext" id="set_bq_home_score_ext" value="' + match_score['other']['home']  + '"  required   autocomplete="off" class="layui-input">' +
+                    '    </div>' +
+                    '    <div class="layui-input-inline" style="width: 35px;">' +
+                    '      <input type="text" name="set_bq_guest_score_ext"  id="set_bq_guest_score_ext"   value="' + match_score['other']['guest']  + '"   required   autocomplete="off" class="layui-input">' +
+                    '    </div>' +
+                    '  </div>' ;
+
+
+
+
+            layer.open({
+                area: ['800px', '300px'], //宽高
+                type: 1,
+                title: '设置比分',
+                content: content, //这里content是一个DOM,注意:最好该元素要存放在body最外层,否则可能被其它的相对元素所影响,
+                btn: ['提交', '取消'],
+                yes: function (index, layero) {
+
+                    let home_scores=[],guest_scores=[],str_home,str_guest,i;
+                    for (i=0;i<=8;i++){
+                        str_home = '#set_bq_home_score_'+(i+1);
+                        str_guest = '#set_bq_guest_score_'+(i+1);
+                        home_scores.push($(str_home).val());
+                        guest_scores.push($(str_guest).val());
+                        //home_scores[i] = $(str_home).val();
+                        //guest_scores[i] = $(str_guest).val();
+                        //console.log(home_scores[i],guest_scores[i]);
+                    }
+
+                    matchdata = JSON.stringify({
+                        'home':home_scores,
+                        'guest':guest_scores,
+                        'home_other':$("#set_bq_home_score_ext").val(),
+                        'guest_other':$("#set_bq_guest_score_ext").val(),
+                    });
+
+                    // 请求设置接口
+                    ajax_setScore_all_v2(order_id,game_code,match_id,matchdata);
+                    return true;
+                },
+            });
+
             return ;
         }
 
-        function setScore_v2_wq($orderObj, $resultObj) {
-            layer.msg('还未定怎么做,等等.....');
+        function setScore_v2_wq(orderObj, resultObj,order_id,match_id,game_code) {
+            let match_score = JSON.parse(resultObj.inning);
+
+            let content = '<div style="width: 100%;height:25px;"></div><div class="layui-form-item">' +
+                '  <div class="layui-inline">' +
+                '    <label class="layui-form-label" style="width: 100px;">主队各盘得分:</label>' ;
+
+            tmp = '' ;
+            for (let i=1;i<=5;i++){
+                tmp +=   '<div class="layui-input-inline" style="width: 30px;">' +
+                    '      <input type="text" name="set_wq_home_score_'+i+'" id="set_wq_home_score_'+i+'" value="' + match_score[i]['home'] + '"  required   autocomplete="off" class="layui-input">' +
+                    '    </div>';
+            }
+            content = content + tmp ;
+            content +=  '  </div>' +
+                '  <div class="layui-inline">' +
+                '    <label class="layui-form-label" style="width: 100px;">客队各盘得分:</label>' ;
+            tmp = '' ;
+            for (let i=1;i<=5;i++){
+                tmp +=     '    <div class="layui-input-inline" style="width: 30px;">' +
+                    '      <input type="text" name="set_wq_gueste_score_'+i+'" id="set_wq_guest_score_'+i+'"  value="' +  + match_score[i]['guest']  + '"  required   autocomplete="off" class="layui-input">' +
+                    '    </div>' ;
+            }
+            content = content + tmp ;
+            content +=  '  </div>' ;
+            content +=     '</div>';
+
+            layer.open({
+                area: ['800px', '200px'], //宽高
+                type: 1,
+                title: '设置比分',
+                content: content, //这里content是一个DOM,注意:最好该元素要存放在body最外层,否则可能被其它的相对元素所影响,
+                btn: ['提交', '取消'],
+                yes: function (index, layero) {
+
+                    let home_scores=[],guest_scores=[],str_home,str_guest,i;
+                    for (i=0;i<=8;i++){
+                        str_home = '#set_wq_home_score_'+(i+1);
+                        str_guest = '#set_wq_guest_score_'+(i+1);
+                        home_scores.push($(str_home).val());
+                        guest_scores.push($(str_guest).val());
+                    }
+
+                    matchdata = JSON.stringify({
+                        'home':home_scores,
+                        'guest':guest_scores
+                    });
+
+                    // 请求设置接口
+                    ajax_setScore_all_v2(order_id,game_code,match_id,matchdata);
+                    return true;
+                },
+            });
+
             return ;
         }
-
+        function  ajax_setScore_all_v2(order_id, game_code, match_id, matchdata){
+            // 请求设置接口
+            $.ajax({
+                type: 'POST',
+                dataType: 'json',
+                url: '/admin/SoccerNoteList/manualmatchpdate_v2',
+                data: {order_id: order_id, game_code: game_code, match_id: match_id, matchdata: matchdata},
+                success: function (res) {
+                    if (1 == res.status) {
+                        layer.alert("设置成功", {title: '友情提示', icon: 1, closeBtn: 0}, function () {
+                            window.location.reload();
+                        });
+                    } else {
+                        layer.alert("服务器异常(0)", {title: '友情提示', icon: 2});
+                    }
+                },
+                error: function () {
+                    layer.alert("服务器异常(1)", {title: '友情提示', icon: 2});
+                }
+            })
+        }
 
 
         // 设置结算比分

+ 4 - 0
routes/web.php

@@ -68,6 +68,10 @@ Route::post('/setResultExpress', function () {
 Route::post('/setMatchWarn', function () {
     return appExec('api', 'WriteSports', 'setMatchWarn');
 });
+//写入危险球数据
+Route::post('/HandleOrder', function () {
+    return appExec('api', 'WriteSports', 'HandleOrder');
+});
 //获取联赛所属国家地区
 Route::post('/getArea', function () {
     return appExec('api', 'WriteSports', 'getArea');