Browse Source

异常处理

彭俊 6 năm trước cách đây
mục cha
commit
07aa0da282

+ 10 - 6
app/Http/Controllers/Admin/SoccerNoteListController.php

@@ -34,6 +34,7 @@ class SoccerNoteListController extends Controller
         $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['game_status'] = isset($req->game_status) ? trim($req->game_status) : 0;
         $request['type'] = isset($req->type) ? trim($req->type) : 'zq';
         $dt = \App\Lib\DataTable\DataTable::init();
         $dt->setDataSource('/admin/SoccerNoteList/getinfo');
@@ -50,12 +51,15 @@ class SoccerNoteListController extends Controller
         $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' => 114));
-        //$arr[] = 'view';/
-//        if (checkRriv('/admin/SoccerNoteList/edit')) {
-//            $arr[] = 'edit';
-//        }
-//        $dt->setToolBar($arr, array('width' => 70));
+        // $dt->addColsFields('game_status', array('templet' => '#game_status', 'sort' => false, 'width' => 114));
+        $dt->addColsFields('game_status', array('sort' => false, 'width' => 80));
+
+
+    //     $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));
     }

+ 11 - 1
app/Http/Controllers/Admin/SportsbkController.php

@@ -32,7 +32,7 @@ class SportsbkController extends Controller {
 		$dt->addColsFields('guest_team', array('templet' => '#userdetail', 'sort' => false, 'width' => 100));
 		$dt->addColsFields('dsnum', array('templet' => '#dsnum', 'sort' => false, 'width' => 70));
 		$dt->addColsFields('csnum', array('templet' => '#csnum', 'sort' => false, 'width' => 70));
-		$dt->addColsFields('match_score', array('sort' => false, 'width' => 170));
+		$dt->addColsFields('match_score', array('templet' => '#match_score','sort' => false, 'width' => 170));
 //		$dt->addColsFields('sectionone_two', array('templet' => '#sectionone_two', 'sort' => false, 'width' => 170));
 //		$dt->addColsFields('sectionthere_four', array('templet' => '#sectionthere_four', 'sort' => false, 'width' => 220));
 		$dt->addColsFields('status', array('templet' => '#matchstatus', 'sort' => false, 'width' => 80));
@@ -331,6 +331,16 @@ class SportsbkController extends Controller {
 			$data['data'][$i]['szteamscore'] = $home_score[3];//第三节主队比分
 			$data['data'][$i]['akteamscore'] = $guest_score[4];//第四节客队比分
 			$data['data'][$i]['azteamscore'] = $home_score[4];//第四节主队比分
+
+			if(empty($data['data'][$i]['match_score'])){
+				$data['data'][$i]['home_scores'] = 0;
+				$data['data'][$i]['guest_scores'] = 0;
+			}else{
+				$scores = explode(':',$data['data'][$i]['match_score']);
+				$data['data'][$i]['home_scores'] = $scores[0];
+				$data['data'][$i]['guest_scores'] = $scores[1];
+			}
+
 		}
 
 		return \App\Lib\DataTable\DataTable::init()->toJson($data['data'], $data['total']);

+ 1 - 1
app/Http/Controllers/Admin/SportsbqController.php

@@ -32,7 +32,7 @@ class SportsbqController extends Controller {
         $dt->addColsFields('dsnum', array('templet' => '#dsnum', 'sort' => false, 'width' => 80));
 		// $dt->addColsFields('csnum', array('templet' => '#home_rate', 'sort' => false, 'width' => 80));
 		$dt->addColsFields('csnum', array('templet' => '#csnum', 'sort' => false, 'width' => 110));		
-        $dt->addColsFields('match_score', array( 'sort' => false, 'width' => 220));//'templet' => '#match_score',
+        $dt->addColsFields('match_score', array( 'templet' => '#match_score','sort' => false, 'width' => 220));//
         $dt->addColsFields('statusmatch', array('templet' => '#statusmatch', 'sort' => false, 'width' => 80));
         $dt->addColsFields('operation', array('templet' => '#operation', 'sort' => false, 'width' => 300));
         $dt->enableCheckBox();

+ 3 - 3
app/Http/Controllers/Admin/SportsfootController.php

@@ -455,10 +455,10 @@ class SportsfootController extends Controller {
         $dt->addColsFields('totime', array('templet' => '#totime', 'sort' => false, 'width' => 155));
         $dt->addColsFields('home_team', array('templet' => '#userdetail', 'sort' => false, 'width' => 90));
 		$dt->addColsFields('guest_team', array('templet' => '#userdetail', 'sort' => false, 'width' => 90));
-		$dt->addColsFields('dsnum', array('templet' => '#dsnum', 'sort' => false, 'width' => 70));
+		$dt->addColsFields('dsnum', array('templet' => '#dsnum', 'sort' => false, 'width' => 100));
 		$dt->addColsFields('csnum', array('templet' => '#csnum', 'sort' => false, 'width' => 100));
-		$dt->addColsFields('match_score', array('sort' => false, 'width' => 210));
-		//$dt->addColsFields('sxalfcourt', array('templet' => '#sxalfcourt', 'sort' => false, 'width' => 210));
+		//$dt->addColsFields('match_score', array('sort' => false, 'width' => 210));
+		$dt->addColsFields('match_score', array('templet' => '#match_score', 'sort' => false, 'width' => 180));
         $dt->addColsFields('statusmatch', array('templet' => '#statusmatch', 'sort' => false, 'width' => 100,'align' => 'left'));
 		$dt->addColsFields('operation', array('templet' => '#status', 'sort' => false, 'width' => 300));
         // $arr[] = 'view';

+ 4 - 3
app/Http/Controllers/Admin/SportswqController.php

@@ -39,7 +39,7 @@ class SportswqController extends Controller {
         $dt->addColsFields('dsnum', array('templet' => '#dsnum', 'sort' => false, 'width' => 80));
 		// $dt->addColsFields('csnum', array('templet' => '#home_rate', 'sort' => false, 'width' => 80));
 		$dt->addColsFields('csnum', array('templet' => '#csnum', 'sort' => false, 'width' => 110));
-        $dt->addColsFields('match_score', array('sort' => false, 'width' => 160));//'templet' => '#matchscore',
+        $dt->addColsFields('match_score', array('templet' => '#matchscore', 'sort' => false, 'width' => 160));
         $dt->addColsFields('statusmatch', array('templet' => '#statusmatch', 'sort' => false, 'width' => 80));
         $dt->addColsFields('operation', array('templet' => '#operation', 'sort' => false, 'width' => 300));
         $dt->enableCheckBox();
@@ -95,7 +95,7 @@ class SportswqController extends Controller {
 
         $newapp = new \App\Models\Stwqresult();
         $data = $newapp->resultlist($list, $page, $where, $orwhere);
-        
+
         return \App\Lib\DataTable\DataTable::init()->toJson($data['data'], $data['total']);
 	}
 
@@ -284,8 +284,9 @@ class SportswqController extends Controller {
 			"first_inning_score"=>$data[1]['home'].':'.$data[1]['guest'],
 			"second_inning_score"=>$data[2]['home'].':'.$data[2]['guest'],
 			"third_inning_score"=>$data[3]['home'].':'.$data[3]['guest'],
-			'is_correct'=>1,
+			'is_correct'=>1
 		];
+
 		\App\Models\Stwqresult::where('match_id', $match_id)->update($updatainfo);
 
 		$addnew = new \App\Models\Comendnotice();

+ 17 - 9
app/Models/SportsNoteList.php

@@ -160,13 +160,20 @@ class SportsNoteList extends BaseModel
             } else if ($v->status == 3) {
                 $v->order_status = '撤单<br>'.$settle_status;
             }
-            if ($v->game_status == 0) {
-                $v->game_status = '未处理';
-            } else {
-                $v->game_status = '已处理';
+
+            //操作
+            if($v->status==1){
+                $v->game_status = '
+                <button style="margin-left: 0;" onclick="setScore_v2()"  class="layui-btn layui-btn-sm settlement">结算</button>
+                <br>
+                <a class="layui-btn layui-btn-sm invalid" style="background-color:red" lay-event="detail" pid="id" uri="/admin/SoccerNoteList/invalid/?id=" href="javascript:invalid(\'/admin/SoccerNoteList/invalid/?id=' . $v->id . '\',\''.$v->order_id.'\',\''.$v->league.'\');"> 作废 </a>';
+            }else{
+                $v->game_status = '
+                <button style="margin-left: 0;" onclick="setScore_v2()"  class="layui-btn layui-btn-sm settlement">结算</button>
+                <br>
+                <a class="layui-btn layui-btn-sm invalid" style="background-color:red" lay-event="detail" pid="id" uri="/admin/SoccerNoteList/invalid/?id=" href="javascript:invalid(\'/admin/SoccerNoteList/invalid/?id=' . $v->id . '\',\''.$v->order_id.'\',\''.$v->league.'\');"> 作废 </a>';
+      
             }
-            //===end===
-          
         }
         return $orderData->toArray();
     }
@@ -187,9 +194,10 @@ class SportsNoteList extends BaseModel
         }
 
         // 当前赛事 投注 结果  0未处理  1 赢 -1输  2平 3赢半平半  4输半平半
-        if ($content_str['result'] == 0) {
+        if ($content_str['result'] == 0 || $order->status > 1) {
             $content = $content1.$content_str['content'];
-        } else {
+        }
+        else if($order->status == 1) {
             if ($content_str['result'] == 0) {
                 $content_str['result'] = '未处理';
             }
@@ -1680,7 +1688,7 @@ class SportsNoteList extends BaseModel
                     $models->status = '1';//1成功 2失败
                 
                     //更新订单数据
-                    $ret_order = self::where('id', $v['id'])->update(['status' => '2','use_mark'=>'因赛事取消,作废注单']);
+                    $ret_order = self::where('id', $v['id'])->update(['status' => '2','use_mark'=>'']);//因赛事取消,作废注单
                     if($ret_order < 1)  throw new \Exception( Response::generate('',Response::UP_ORDER_ERR));
 
                     //更新用户数据

+ 1 - 1
resources/lang/zh-cn/sportsbk.php

@@ -14,7 +14,7 @@ return array(
     'all_goal' => '总进球数',
     'first_score' => '最先进球球队',
 	'last_score' => '最后进球球队',
-	'match_score' => '赛事比分',
+	'match_score' => '赛事比分(主/客)',
 	'match_winer' => '获胜球队',
 	'update_time' => '更新时间',
 	'match_time' => '进行时间',

+ 1 - 1
resources/lang/zh-cn/sportsfoot.php

@@ -12,7 +12,7 @@ return array(
     'status' => '状态',
     'first_score' => '最先进球球队',
 	'last_score' => '最后进球球队',
-	'match_score' => '赛事比分',
+	'match_score' => '赛事比分(主/客)',
 	'match_winer' => '获胜球队',
 	'update_time' => '更新时间',
 	'match_time' => '比赛进行时间',

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

@@ -27,7 +27,7 @@ return array(
     'money_time' => '下注时间',
     'prize' => '开奖号码',
     'settle_status' => '结算状态',
-    'game_status' => '开奖状态',
+    'game_status' => '操作',
     'match_status' => '状态',
     'member_type' => '会员类型',
     'edit' => '修改',

+ 6 - 4
resources/views/admin/Sportsbq/outcome.blade.php

@@ -19,12 +19,14 @@
     </script>
 
     <script type="text/html" id="match_score">
+        <!--
             <input type="text" style="width:30px;heigth:20px" id="u_home_score@{{d.match_id}}" name="u_home_score" value="@{{d.u_home_score}}"> 
-            <input type="text" style="width:30px;heigth:20px" id="u_guest_score@{{d.match_id}}" name="u_guest_score" value="@{{d.u_guest_score}}"> / 
-            <input type="text" style="width:30px;heigth:20px" id="home_score@{{d.match_id}}" name="home_score" value="@{{d.home_score}}">
-            <input type="text" style="width:30px;heigth:20px" id="guest_score@{{d.match_id}}" name="guest_score" value="@{{d.guest_score}}">
+            <input type="text" style="width:30px;heigth:20px" id="u_guest_score@{{d.match_id}}" name="u_guest_score" value="@{{d.u_guest_score}}"> / -->
+            <input type="text" style="width:30px;heigth:20px" id="home_score@{{d.match_id}}" name="home_score" value="@{{d.home_score}}" readonly="readonly">
+            <input type="text" style="width:30px;heigth:20px" id="guest_score@{{d.match_id}}" name="guest_score" value="@{{d.guest_score}}" readonly="readonly">
             <input type="hidden" style="width:30px;heigth:20px" id="match_status@{{d.match_id}}" name="guest_score" value="@{{d.status}}">
-            <button class="layui-icon" onclick="teamscore(@{{d.match_id}})"><h6>提交</h6></button>
+        <!--
+            <button class="layui-icon" onclick="teamscore(@{{d.match_id}})"><h6>提交</h6></button> -->
     </script>
 
     <script type="text/html" id="dsnum">

+ 4 - 3
resources/views/admin/Sportswq/outcome.blade.php

@@ -14,10 +14,11 @@
     </script>
 
     <script type="text/html" id="matchscore"> 
-            <input type="text" style="width:30px;heigth:20px" id="home_player_score@{{d.match_id}}" name="home_player_score" value="@{{d.home_player_score}}"> /
-            <input type="text" style="width:30px;heigth:20px" id="guest_player_score@{{d.match_id}}" name="guest_player_score" value="@{{d.guest_player_score}}">
+            <input type="text" style="width:30px;heigth:20px" id="home_player_score@{{d.match_id}}" name="home_player_score" value="@{{d.home_player_score}}" readonly="readonly">
+            <input type="text" style="width:30px;heigth:20px" id="guest_player_score@{{d.match_id}}" name="guest_player_score" value="@{{d.guest_player_score}}" readonly="readonly">
             <input type="hidden" style="width:30px;heigth:20px" id="match_status@{{d.match_id}}" name="guest_score" value="@{{d.status}}">
-            <button class="layui-icon" onclick="inputscore(@{{d.match_id}})"><h6>提交</h6></button>
+            <!--
+            <button class="layui-icon" onclick="inputscore(@{{d.match_id}})"><h6>提交</h6></button>-->
     </script>
 
     <script type="text/html" id="dsnum">

+ 5 - 0
resources/views/admin/sportsbk/outcome.blade.php

@@ -183,6 +183,11 @@
         @{{#} }}
         -->
     </script>
+
+    <script type="text/html" id="match_score">
+        <input type="text" style="width:30px;heigth:20px" id="ozteamscore@{{d.match_id}}" name="ozteamscore" value="@{{d.home_scores}}" readonly="readonly">
+        <input type="text" style="width:30px;heigth:20px" id="okteamscore@{{d.match_id}}" name="okteamscore" value="@{{d.guest_scores}}" readonly="readonly">
+    </script>
     
     <script type="text/html" id="sectionone_two">
         <input type="text" style="width:30px;heigth:20px" id="ozteamscore@{{d.match_id}}" name="ozteamscore" value="@{{d.ozteamscore}}">

+ 5 - 0
resources/views/admin/sportsfoot/outcome.blade.php

@@ -78,6 +78,11 @@
       @{{#} }}
     </script>
 
+    <script type="text/html" id="match_score">
+        <input type="text" style="width:30px;heigth:20px" id="home_score@{{d.match_id}}" name="home_score" value="@{{d.home_score}}" readonly="readonly">
+        <input type="text" style="width:30px;heigth:20px" id="guest_score@{{d.match_id}}" name="guest_score" value="@{{d.guest_score}}" readonly="readonly">
+    </script>
+
     <script type="text/html" id="sxalfcourt">
             <input type="text" style="width:30px;heigth:20px" id="u_home_score@{{d.match_id}}" name="u_home_score" value="@{{d.u_home_score}}" >
             <input type="text" style="width:30px;heigth:20px" id="u_guest_score@{{d.match_id}}" name="u_guest_score" value="@{{d.u_guest_score}}"> /

+ 5 - 3
resources/views/sports/sports_notelist.blade.php

@@ -14,14 +14,16 @@
         -->
 
         <!--<button style="margin-left: 0;" onclick="setScore('@{{d.order_id}}','@{{d.match_id}}')" class="layui-btn layui-btn-sm settlement">手动设置比分</button>-->
-        <button style="margin-left: 0;" onclick="setScore_v2('@{{d.order_id}}','@{{d.match_id}}','@{{d.game_code}}')"  class="layui-btn layui-btn-sm settlement">手动设置比分</button>
+        <!-- <button style="margin-left: 0;" onclick="setScore_v2('@{{d.order_id}}','@{{d.match_id}}','@{{d.game_code}}')"  class="layui-btn layui-btn-sm settlement">结算</button> -->
+        <!-- <button style="margin-left: 0;" onclick="setScore_v2('@{{d.order_id}}','@{{d.match_id}}','@{{d.game_code}}')"  class="layui-btn layui-btn-sm settlement">结算</button> -->
 
-        @{{#if(d.settle_status==1){ }}
+   
+        <!-- @{{#if(d.settle_status==1){ }}
             <span>未结算</span>
         @{{#} }}<br>
         @{{#if(d.settle_status==2){ }}
             <span>已结算</span>
-        @{{#} }}
+        @{{#} }} -->
 
 
         <!--