Ver Fonte

异常处理

彭俊 há 6 anos atrás
pai
commit
6d37552e2c

+ 7 - 1
app/Http/Controllers/Admin/Priv_codeController.php

@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Admin;
 
 use App\Http\Controllers\Controller;
 use Illuminate\Http\Request;
+use DB;
 
 class Priv_codeController extends Controller {
 
@@ -90,6 +91,8 @@ class Priv_codeController extends Controller {
 		$field = !empty($req->field) ? $req->field : '';
 		$order = !empty($req->order) ? $req->order : 'asc';
 
+        DB::connection()->enableQueryLog();
+
 		$model = \App\Models\Priv_codeModel::offset(($page - 1) * $limit)
 			->limit($limit);
 		if (!empty($field) && !empty($order)) {
@@ -118,11 +121,14 @@ class Priv_codeController extends Controller {
 		}
 		 **/
 
-		$data = $model->orderby('id','desc')->get();
+		$data = $model->get();
 		if (!$data) {
 			return;
 		}
 		$data = $data->toArray();
+
+       // print_r(DB::getQueryLog());
+
 		$count = \App\Models\Priv_codeModel::count();
 		return \App\Lib\DataTable\DataTable::init()->toJson($data, $count);
 	}

+ 17 - 30
app/Http/Controllers/Admin/SportsbkController.php

@@ -30,8 +30,8 @@ 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('sectionone_two', array('templet' => '#sectionone_two', 'sort' => false, 'width' => 180));
-		$dt->addColsFields('sectionthere_four', array('templet' => '#sectionthere_four', 'sort' => false, 'width' => 180));
+		$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));
 		$dt->addColsFields('operation', array('templet' => '#operation', 'sort' => false, 'width' => 300));
 
@@ -227,39 +227,26 @@ class SportsbkController extends Controller {
 
 	//修改添加赛事比分
 	function updatascore(Req $req){
-		$only = $req->only;//节数唯一标识
 		$match_id = $req->match_id;//节数唯一标识
-		$okteamscore = intval($req->okteamscore);//第一节客队比分
-		$ozteamscore = intval($req->ozteamscore);//第一节主队比分
-		$tkteamscore = intval($req->tkteamscore);//第二节客队比分
-		$tzteamscore = intval($req->tzteamscore);//第二节主队比分
-		$skteamscore = intval($req->skteamscore);//第三节客队比分
-		$szteamscore = intval($req->szteamscore);//第三节主队比分
-		$akteamscore = intval($req->akteamscore);//第四节客队比分
-		$azteamscore = intval($req->azteamscore);//第四节主队比分
 
 		$model = \App\Models\Stlqresult::where('match_id', $match_id)->first();
 		$model->update_time = date('Y-m-d H:i:s');
-		$model->match_process = 1;
 			
-		if($only==1 || $only==3 || $only==5 || $only==7){
-			$guestscore =array(
-				'1' => $okteamscore,
-				'2' => $tkteamscore,
-				'3' => $skteamscore,
-				'4' => $akteamscore,
-			);
-			$model->guest_score = json_encode($guestscore);
-		}
-		if($only==2 || $only==4 || $only==6 || $only==8){
-			$homescore =array(
-				'1' => $ozteamscore,
-				'2' => $tzteamscore,
-				'3' => $szteamscore,
-				'4' => $azteamscore,
-			);
-			$model->home_score = json_encode($homescore);
-		}
+		$guestscore =array(
+			'1' => intval($req->okteamscore)?intval($req->okteamscore):0,//第一节客队比分
+			'2' => intval($req->tkteamscore)?intval($req->tkteamscore):0,//第二节客队比分
+			'3' => intval($req->skteamscore)?intval($req->skteamscore):0,//第三节客队比分
+			'4' => intval($req->akteamscore)?intval($req->akteamscore):0,//第四节客队比分
+		);
+		
+		$homescore =array(
+			'1' => intval($req->ozteamscore)?intval($req->ozteamscore):0,//第一节主队比分
+			'2' => intval($req->tzteamscore)?intval($req->tzteamscore):0,//第二节主队比分
+			'3' => intval($req->szteamscore)?intval($req->szteamscore):0,//第三节主队比分
+			'4' => intval($req->azteamscore)?intval($req->azteamscore):0,//第四节主队比分
+		);
+		$model->guest_score = json_encode($guestscore);
+		$model->home_score = json_encode($homescore);
 		$model->save();
 
 		$addnew = new \App\Models\Comendnotice();

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

@@ -232,7 +232,7 @@ class SportsfootController extends Controller {
 		$model->match_winer = $req->matchwiner?$req->matchwiner:'';
 		$model->penalty_card = json_encode($penaltycard,JSON_UNESCAPED_UNICODE);
 		$model->corner_ball = json_encode($cornerball,JSON_UNESCAPED_UNICODE);
-		$model->first_score = json_encode($firstone,JSON_UNESCAPED_UNICODE ); 
+		$model->first_score = json_encode($firstone,JSON_UNESCAPED_UNICODE); 
 
         $model->save();
         return responseToJson(1);

+ 3 - 3
app/Http/Model/StLqResult.php

@@ -121,7 +121,7 @@ class StLqResult extends Model
         $matchData_r = $model['model_result']::select('match_id')
             ->where([['ctime','>',date('Y-m-d H:i:s', strtotime("-2 day"))]])
             ->get()
-            ->toarray();
+            ->toArray();
 
 
         if(!empty($matchData_r)){
@@ -240,8 +240,8 @@ class StLqResult extends Model
                         "home_score"=> json_encode($home_score)?:'', //主队进球数
                         "guest_score"=> json_encode($guest_score)?:'', //客队进球数
                         "all_goal"=> $all_goal?:0, //总进球数
-                        "first_score"=> $result_4['first_score']?:'', //最先进球球队
-                        "last_score"=> $result_4['last_score']?:'', //最后进球球队
+                        // "first_score"=> $result_4['first_score']?:'', //最先进球球队
+                        // "last_score"=> $result_4['last_score']?:'', //最后进球球队
                         "match_score"=> $result_4['match_score']?:0, //赛事比分
                         "match_winer"=>  $match_winer?:'',//获胜球队
                         "match_process"=> $result_4['match_process']?:'',//比赛进程

+ 242 - 1
app/Http/Model/StWqResult.php

@@ -3,6 +3,8 @@ namespace App\Http\Model;
 
 use Illuminate\Database\Eloquent\Model;
 use App\Http\Response\Response;
+use Illuminate\Support\Facades\DB;
+use App\Lib\Biz\Sport\Common as commonFunction;
 
 /**
  * Class StWqResult
@@ -16,14 +18,252 @@ class StWqResult extends Model
 
     /*
      * 写赛事结果
+     * 弃用
      */
-    public static function WQresult($model){
+    public static function WQresult__($model){
         //获取赛事表7天内所有赛事
         $matchData = $model['model_match']::select('id','home_team','guest_team','lg_id','status','tag','match_date','match_time')
+            ->where([['match_date','>',date('Y-m-d',strtotime("-2 day"))],['status','=',2]])
+            ->get()
+            ->toArray();
+
+        //没有数据,无需操作
+        if(empty($matchData)) return Response::success();
+        //获取赛事结果表 所有当月
+        $matchData_r = $model['model_result']::select('match_id')
             ->where([['ctime','>',date('Y-m-d H:i:s', strtotime("-7 day"))]])
             ->get()
             ->toarray();
 
+        //结果表无数据,直接插入
+        if(empty($matchData_r)){
+            foreach ($matchData as $k=>$v){
+                $start_time = ($v['match_date'].' '.$v['match_time']);
+                $time = time()-strtotime($v['match_time']);
+                $match_time = self::secTime($time);
+                $set_match_r[] = [
+                    "match_id"=> $v['id'],
+                    "home_player_name"=>$v['home_team'],
+                    "guest_player_name"=>$v['guest_team'],
+                    "lg_id"=>$v['lg_id'],
+                    "status"=>$v['status'],
+                    "tag"=> $v['tag'],
+                    'match_time'=>$match_time,
+                    "ctime"=>date('Y-m-d H:i:s'),
+                    "update_time"=>date('Y-m-d H:i:s'),
+                    "start_time"=>date('Y-m-d H:i:s',strtotime($start_time))
+                ];
+            }
+            $ret = $model['model_result']::insert($set_match_r);
+            if($ret != true) throw new \Exception( Response::generate('',Response::ADD_MATCH_R_ERROR));
+        }else {
+
+            //如果结果表有数据,则获取结果表没有的赛事
+            foreach ($matchData as $k => $v) {
+                foreach ($matchData_r as $kk => $vv) {
+                    if ($v['id'] == $vv['match_id']) {
+                        unset($matchData[$k]);
+                    }
+                }
+            }
+            //如果还有未写入赛事
+            if (!empty($matchData)) {
+                //写入结果表不存在赛事
+                foreach ($matchData as $k => $v) {
+                    $start_time = ($v['match_date'] . ' ' . $v['match_time']);
+                    $time = time() - strtotime($v['match_time']);
+                    $match_time = self::secTime($time);
+                    $set_match_r[] = [
+                        "match_id" => $v['id'],
+                        "home_player_name" => $v['home_team'],
+                        "guest_player_name" => $v['guest_team'],
+                        "lg_id" => $v['lg_id'],
+                        "status" => $v['status'],
+                        "tag" => $v['tag'],
+                        'match_time' => $match_time,
+                        "ctime" => date('Y-m-d H:i:s'),
+                        "update_time" => date('Y-m-d H:i:s'),
+                        "start_time" => date('Y-m-d H:i:s', strtotime($start_time))
+                    ];
+                }
+                $ret = $model['model_result']::insert($set_match_r);
+                if ($ret != true) throw new \Exception(Response::generate('', Response::ADD_MATCH_R_ERROR));//Render([], '10022', lang('Tips','Sports')->get('add_match_r_error'));
+            }
+        }
+    }
+    public static function WQresult($model){
+
+        //获取赛事表7天内所有赛事
+        $matchData = $model['model_match']::select('id','home_team','guest_team','lg_id','status','tag','match_date','match_time')
+            ->where([['match_date','>',date('Y-m-d',strtotime("-2 day"))],['status','=',2]])
+            ->get()
+            ->toArray();
+
+        //获取赛事结果表 一天内
+        $matchData_r = $model['model_result']::select('match_id')
+            ->where([['ctime','>',date('Y-m-d H:i:s', strtotime("-2 day"))]])
+            ->get()
+            ->toArray();
+
+        if(!empty($matchData_r)){
+            //如果结果表有数据,则获取结果表没有的赛事
+            foreach ($matchData as $k => $v) {
+                foreach ($matchData_r as $kk => $vv) {
+                    if ($v['id'] == $vv['match_id']) {
+                        unset($matchData[$k]);
+                    }
+                }
+            }
+        }
+
+         //没有数据,无需操作
+         if(empty($matchData)) return Response::success();
+        
+         //获取赛事id 用于获取赛事对应结果比分
+         $match_ids = [];
+         foreach($matchData as $k =>$v){
+             //只获取赛事已结束的
+             if($v['status'] == 2){
+                 $match_ids[] = $v['id'];
+             }
+         }
+ 
+         $match_ids_str = implode(",", $match_ids);
+
+        //组装sql match_process = '第一节' and
+        //获取赛事最终赛果
+        $sql_result = "select a.match_id,a.home_player_score,a.guest_player_score,a.match_time as a_time,a.home_player_let_plate,a.guest_player_let_plate,a.home_player_let_inning,a.guest_player_let_inning,a.all_inning,a.match_process,a.first_score_player,a.last_score_player,a.first_inning_score,a.second_inning_score,a.third_inning_score,a.match_winer_player,a.result_mark from st_wq_result_record a,
+        (select match_id,max(id) id from st_wq_result_record where match_id IN ($match_ids_str) group by match_id)b
+        where a.match_id = b.match_id and a.id = b.id ";
+
+        //赛事最终结果
+        $match_result = DB::select($sql_result);
+
+        //拼装赛事结果数据 
+        $set_match_r = [];
+
+        if(!empty($match_result)){
+            foreach($matchData as $k =>$v ){
+                //获取开赛时间
+                $start_time = ($v['match_date'].' '.$v['match_time']);
+                $time = time()-strtotime($v['match_time']);
+                $match_time = self::secTime($time);
+                //获取赛事每节的赛果
+                $resultData = commonFunction::filter_by_value($match_result,'match_id',$v['id']);
+            
+                if(!empty($resultData)){
+                    //获取赛果json
+                    $result_mark = json_decode($resultData['result_mark'],true);
+
+                    //获取进程
+                    $match_process = $result_mark['schedule'];
+
+                    //获胜球员
+                    $match_winer = '';
+                    if($result_mark['game_num_H'] > $result_mark['game_num_C']){
+                        $match_winer = $v['home_team'];
+                    }else{
+                        $match_winer = $v['guest_team'];
+                    }
+
+                    dd($result_mark['best']);
+                    //组装输赢结果json
+                    if($result_mark['best'] == 3)
+                    $inning = [
+                        1=>[
+                            "home"=>[
+                                1=>1,
+                                2=>0,
+                                3=>1,
+                                4=>1,
+                            ],
+                            "guest"=>[
+                                1=>1,
+                                2=>0,
+                                3=>1,
+                                4=>1,
+                            ],
+                        ],
+                        2=>[
+                            "home"=>[
+                                1=>1,
+                                2=>0,
+                                3=>1,
+                                4=>1,
+                            ],
+                            "guest"=>[
+                                1=>1,
+                                2=>0,
+                                3=>1,
+                                4=>1,
+                            ],
+                        ],
+                        3=>[
+                            "home"=>[
+                                1=>1,
+                                2=>0,
+                                3=>1,
+                                4=>1,
+                            ],
+                            "guest"=>[
+                                1=>1,
+                                2=>0,
+                                3=>1,
+                                4=>1,
+                            ],
+                        ],
+
+                    ];
+                  
+                    dd(json_encode($inning));
+
+                    //赛事待写入赛果数据
+                    $set_match_r[] = [
+                        "match_id"=> $v['id'],
+                        "home_player_name"=>$v['home_team'],
+                        "guest_player_name"=>$v['guest_team'],
+                        "lg_id"=>$v['lg_id'],
+                        "status"=>$v['status'],
+                        "tag"=> $v['tag'],
+                        'match_time'=>$resultData['a_time']?:0,
+                        "ctime"=>date('Y-m-d H:i:s'),
+                        "update_time"=>date('Y-m-d H:i:s'),
+                        "start_time"=>date('Y-m-d H:i:s',strtotime($start_time)),
+
+                        "home_player_let_plate"=> $resultData['home_player_let_plate']?:0, //主队让盘
+                        "guest_player_let_plate"=> $resultData['guest_player_let_plate']?:0, //客队让盘
+                        "home_player_let_inning"=> $resultData['home_player_let_inning']?:0, //主队让局
+                        "guest_player_let_inning"=> $resultData['guest_player_let_inning']?:0, //客队让局
+                        "home_player_score"=> json_encode($home_score)?:'', //主队得分
+                        "guest_player_score"=> json_encode($guest_score)?:'', //客队得分
+                        "all_inning"=> $resultData['all_inning']?:0, //总局数
+                        "first_score_player"=> $resultData['first_score']?:'', //最先得分
+                        "last_score_player"=> $resultData['last_score']?:'', //最后得分
+                        "first_inning_score"=> $resultData['first_inning_score']?:0, //第一局比分
+                        "second_inning_score"=> $resultData['second_inning_score']?:0,//第二局比分
+                        "third_inning_score"=> $resultData['third_inning_score']?:0,//第三局比分
+                        // "match_score"=> ,//赛事比分
+                        "match_winer_player"=>  $match_winer?:'',//获胜队员
+                        "match_process"=> $match_process?:'',//比赛进程
+                        // "inning"=> ,//每局输赢结果
+                    ];    
+                }
+            }
+        }
+
+
+        //写入赛果
+        if(!empty($set_match_r)){
+            $ret = $model['model_result']::insert($set_match_r);
+            if($ret != true) throw new \Exception( Response::generate('',Response::ADD_MATCH_R_ERROR));
+        }
+
+        return 1;
+
+
+        
+
+        /*
         //没有数据,无需操作
         if(empty($matchData)) return Response::success();
         //获取赛事结果表 所有当月
@@ -87,6 +327,7 @@ class StWqResult extends Model
                 if ($ret != true) throw new \Exception(Response::generate('', Response::ADD_MATCH_R_ERROR));//Render([], '10022', lang('Tips','Sports')->get('add_match_r_error'));
             }
         }
+        */
     }
 
     //计算滚球 赛事进行时间

+ 3 - 3
app/Http/Model/StZqResult.php

@@ -209,7 +209,7 @@ class StZqResult extends Model
         $matchData_r = $model['model_result']::select('match_id')
             ->where([['ctime','>',date('Y-m-d H:i:s', strtotime("-2 day"))]])
             ->get()
-            ->toarray();
+            ->toArray();
 
         if(!empty($matchData_r)){
             //如果结果表有数据,则获取结果表没有的赛事
@@ -311,8 +311,8 @@ class StZqResult extends Model
                             "home_score"=> $vv['home_score']?:0, //主队进球数
                             "guest_score"=> $vv['guest_score']?:0, //客队进球数
                             "all_goal"=> $vv['all_goal']?:0, //总进球数
-                            "first_score"=> $vv['first_score']?:'', //最先进球球队
-                            "last_score"=> $vv['last_score']?:'', //最后进球球队
+                            // "first_score"=> $vv['first_score']?:'', //最先进球球队
+                            // "last_score"=> $vv['last_score']?:'', //最后进球球队
                             "match_score"=> $vv['match_score']?:0, //赛事比分
                             "match_winer"=>  $match_winer?:'',//获胜球队
                             "match_process"=> $vv['match_process']?:'',//比赛进程

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 6
app/Lib/DataTable/DataTable.php


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

@@ -35,9 +35,9 @@ return array(
 	'select_status' => '请选择比赛状态',
 	'dsnum' => '单式单',
 	'csnum' => '串式单',
-	'sectionone_two' =>'第一/二节',
+	'sectionone_two' =>'第一/二节(客/主)',
 	'sectiontwo' => '第二节',
-	'sectionthere_four' => '第三/四节',
+	'sectionthere_four' => '第三/四节(客/主)',
 	'sectionfour' => '第四节',
 	'overtimeone' => '第一加时',
 	'overtimetwo' => '第二加时',

+ 2 - 2
resources/views/admin/Priv_code/index.blade.php

@@ -1,4 +1,4 @@
-@extends('vip.layouts') @section('content')
+@extends('vip.layouts254js') @section('content')
 
 <div class="layui-row">
 
@@ -75,5 +75,5 @@
  });
 
 @endpush
- @include('vip.datatable')
+ @include('vip.datatablev254')
 <link rel="stylesheet" href="{{ asset('/css/untablelist.css') }}" /> @endsection

+ 17 - 20
resources/views/admin/sportsbk/outcome.blade.php

@@ -173,17 +173,18 @@
     </script>
     
     <script type="text/html" id="sectionone_two">
-        <input type="text" style="width:30px;heigth:20px" id="okteamscore@{{d.match_id}}" name="okteamscore" value="@{{d.okteamscore}}" onchange="teamscore(1, event.target.value,@{{ d.match_id}})"> 
-        <input type="text" style="width:30px;heigth:20px" id="ozteamscore@{{d.match_id}}" name="ozteamscore" value="@{{d.ozteamscore}}" onchange="teamscore(2, event.target.value,@{{ d.match_id}})"> / 
-        <input type="text" style="width:30px;heigth:20px" id="tkteamscore@{{d.match_id}}" name="tkteamscore" value="@{{d.tkteamscore}}" onchange="teamscore(3, event.target.value,@{{ d.match_id}})">
-        <input type="text" style="width:30px;heigth:20px" id="tzteamscore@{{d.match_id}}" name="tzteamscore" value="@{{d.tzteamscore}}" onchange="teamscore(4, event.target.value,@{{ d.match_id}})">
+        <input type="text" style="width:30px;heigth:20px" id="okteamscore@{{d.match_id}}" name="okteamscore" value="@{{d.okteamscore}}"> 
+        <input type="text" style="width:30px;heigth:20px" id="ozteamscore@{{d.match_id}}" name="ozteamscore" value="@{{d.ozteamscore}}"> / 
+        <input type="text" style="width:30px;heigth:20px" id="tkteamscore@{{d.match_id}}" name="tkteamscore" value="@{{d.tkteamscore}}">
+        <input type="text" style="width:30px;heigth:20px" id="tzteamscore@{{d.match_id}}" name="tzteamscore" value="@{{d.tzteamscore}}">
     </script>
 
     <script type="text/html" id="sectionthere_four">
-        <input type="text" style="width:30px;heigth:20px" id="skteamscore@{{d.match_id}}" name="skteamscore" value="@{{d.skteamscore}}" onchange="teamscore(5, event.target.value,@{{ d.match_id}})"> 
-        <input type="text" style="width:30px;heigth:20px" id="szteamscore@{{d.match_id}}" name="szteamscore" value="@{{d.szteamscore}}" onchange="teamscore(6, event.target.value,@{{ d.match_id}})"> / 
-        <input type="text" style="width:30px;heigth:20px" id="akteamscore@{{d.match_id}}" name="akteamscore" value="@{{d.akteamscore}}" onchange="teamscore(7, event.target.value,@{{ d.match_id}})">
-        <input type="text" style="width:30px;heigth:20px" id="azteamscore@{{d.match_id}}" name="azteamscore" value="@{{d.azteamscore}}" onchange="teamscore(8, event.target.value,@{{ d.match_id}})">
+        <input type="text" style="width:30px;heigth:20px" id="skteamscore@{{d.match_id}}" name="skteamscore" value="@{{d.skteamscore}}"> 
+        <input type="text" style="width:30px;heigth:20px" id="szteamscore@{{d.match_id}}" name="szteamscore" value="@{{d.szteamscore}}"> / 
+        <input type="text" style="width:30px;heigth:20px" id="akteamscore@{{d.match_id}}" name="akteamscore" value="@{{d.akteamscore}}">
+        <input type="text" style="width:30px;heigth:20px" id="azteamscore@{{d.match_id}}" name="azteamscore" value="@{{d.azteamscore}}">
+        <button class="layui-btn layui-btn-sm lay-btn-diy" onclick="teamscore(@{{d.match_id}})"><h6>提交</h6></button>
     </script>
 
     <script type="text/html" id="status">
@@ -474,12 +475,10 @@
             })
         }
 
-        //修改赛事比分  only:唯一 num:inputval match_id:match_id
-        function teamscore(only,num,match_id){
-            var only = only;
-            var num = num;
+        //修改赛事比分  only:唯一 num:inputval match_id:match_id 
+        function teamscore(match_id){
             var match_id = match_id;
-            var reg = /^[0-99]\d*$/;
+            // var reg = /^[0-99]\d*$/;
             var okteamscore = $("#okteamscore"+match_id).val();
             var ozteamscore = $("#ozteamscore"+match_id).val();
             var tkteamscore = $("#tkteamscore"+match_id).val();
@@ -488,19 +487,17 @@
             var szteamscore = $("#szteamscore"+match_id).val();
             var akteamscore = $("#akteamscore"+match_id).val();
             var azteamscore = $("#azteamscore"+match_id).val();
-            // alert(azteamscore);
-            // alert(akteamscore);
 
-            if(reg.test(num)==false){ 
-                layer.msg('不能为空值');
-                reloadDataTable();return;
-            }
+            // if(reg.test(num)==false){ 
+            //     layer.msg('不能为空值');
+            //     reloadDataTable();return;
+            // }
 
             $.ajax({
                 type: 'POST',
                 dataType: 'json',
                 url: '/admin/Sportsbk/updatascore',
-                data: {only:only,num:num,match_id:match_id,okteamscore:okteamscore,ozteamscore:ozteamscore,tkteamscore:tkteamscore,tzteamscore:tzteamscore,skteamscore:skteamscore,szteamscore:szteamscore,akteamscore:akteamscore,azteamscore:azteamscore},
+                data: {match_id:match_id,okteamscore:okteamscore,ozteamscore:ozteamscore,tkteamscore:tkteamscore,tzteamscore:tzteamscore,skteamscore:skteamscore,szteamscore:szteamscore,akteamscore:akteamscore,azteamscore:azteamscore},
                 success: function(data) {
                     if(data.status==1){
                         layer.msg(data.msg);

+ 212 - 0
resources/views/vip/datatablev254.blade.php

@@ -0,0 +1,212 @@
+<script type="text/html" id="toolbar">
+    <span class="data-attr-{{ $dataId }}" style="display:none"
+          @verbatim{{#  layui.each(d, function(index, item){ }}data-{{ index }}="{{ item }}"{{#  }); }}@endverbatim ></span>
+    @if($dataToolBar!=-1)
+    @foreach ($dataToolBar as $tool)
+    <a class="layui-btn layui-btn-sm {{ $tool }}" lay-event="detail" pid="{{ $primaryKey }}"
+       uri="/{{S('MODULE')}}/{{S('CONTROLLER')}}/{{$tool}}/?{{$primaryKey}}="
+       href="/{{S('MODULE')}}/{{S('CONTROLLER')}}/{{$tool}}/?{{$primaryKey}}=@verbatim{{ d.@endverbatim {{$primaryKey}} @verbatim}}@endverbatim">@if (trans($dataTableLang.'.'.$tool)==$dataTableLang.'.'.$tool) {{ trans('common.'.$tool) }}  @else {{ trans($dataTableLang.'.'.$tool) }}   @endif</a>
+
+    @endforeach
+    @endif
+
+</script>
+<table class="layui-hide" id="{{ $dataId }}" lay-filter="{{ $dataId }}"></table>
+
+<style>
+    .layui-table-view .layui-table {
+        position: relative;
+        width: 100%;
+        margin: 0px;
+    }
+
+    .layui-form {
+        height: auto !important;
+    }
+
+    .layui-table-cell {
+        padding: 0px 12px;
+    }
+</style>
+<script>
+
+    function loadCols() {
+        var cols = @json($dataCols);
+        try {
+            cols = optCols($cols);
+        } catch (ex) {
+        }
+        return cols;
+    }
+
+    function loadData() {
+        return;
+    }
+
+    /**
+     * 初始化where条件
+     **/
+    function initLoadWhere() {
+        var list = {};
+        $('*[eventType=event-query]').each(function (index, item) {
+            var field = $(this).attr('name');
+            var value = $(this).val();
+            try {
+                list[field] = filterWhere(field, value);
+            } catch (ex) {
+                list[field] = value;
+            }
+            list[field] = value;
+        });
+        return list;
+    }
+
+    var tab;
+    var pid = '{{ $primaryKey }}';
+    layui.use(['table', 'form', 'tree', 'laydate'], function () {
+        table = layui.table ,
+            form = layui.form,
+            laydate = layui.laydate //日期;
+
+        //展示已知数据
+        var tableIns = table.render({
+            elem: '#{{ $dataId }} '
+            // ,height: 'full-150'
+            // ,cellMinWidth: 100
+            , cellMinWidth: 50
+            , url: '{!! $dataUri !!}'
+            , where: initLoadWhere()
+            , cols: loadCols()
+            , cellMinWidth: 80
+            //,skin: 'line' //表格风格
+            , even: true
+            , autoSort: false
+            , id: '{{ $dataId }}'
+            , page: true //是否显示分页
+            , limits: [5, 7, 10, 20, 30, 50, 100, 200, 500, 1000, 2000]
+            , limit: 50 //每页默认显示的数量
+            , done: function (res, curr, count) {
+
+//          var width = $('.layui-table').find('th .layui-table-cell').width();
+//
+//          width = parseFloat(width);
+//          $('.layui-table').find('.layui-table-cell').width(width-3)
+                try {
+                    dataTableLoadFinished(res, curr, count);
+                } catch (ex) {
+                }
+                tab = tableIns;
+            }
+        });
+        table.on('sort({{ $dataId }})', function (obj) {
+            table.reload('{{ $dataId }}', {
+                page: {
+                    curr: 1 //重新从第 1 页开始
+                }
+                , initSort: obj
+                , where: {
+                    field: obj.field
+                    , order: obj.type
+                }
+            });
+        });
+        table.on('edit({{ $dataId }})', function (obj) {
+            var value = obj.value //得到修改后的值
+                , data = obj.data //得到所在行所有键值
+                , field = obj.field; //得到字段
+            try {
+                editlineOpt(data.id, field, value);
+            } catch (ex) {
+                editLine('/{{S('MODULE')}}/{{S('CONTROLLER')}}/editCols?id=' + data.id + '&field=' + field + '&value=' + value, '{{ trans("common.editline") }}');
+            }
+        });
+        form.on('switch({{ $dataId }})', function (obj) {
+            try {
+                switchOpt(obj);
+            } catch (ex) {
+            }
+        });
+        form.on('checkbox({{ $dataId }})', function (obj) {
+            try {
+                checkboxOpt(obj);
+            } catch (ex) {
+            }
+        });
+
+        table.on('checkbox({{ $dataId }})', function (obj) {
+            if (g.currentDataTableIdArray == undefined) {
+                g.currentDataTableIdArray = [];
+            }
+            if (obj.checked) {
+                if (obj.type == 'all') {
+                    var checkStatus = table.checkStatus('{{ $dataId }}'), data = checkStatus.data;
+                    for (x in data) {
+                        g.currentDataTableIdArray.push(data[x][pid]);
+                    }
+
+                } else {
+                    g.currentDataTableIdArray.push(obj.data[pid]);
+                }
+
+            } else {
+                var id = obj.data[pid];
+                var index = $.inArray(id, g.currentDataTableIdArray);
+                if (index != -1) {
+                    g.currentDataTableIdArray.splice(index, 1);
+                }
+            }
+            g.currentDataTableIds = g.currentDataTableIdArray.join(',');
+            console.log(g.currentDataTableIds);
+        });
+
+        //获取今日号
+        var data = new Date();
+        var m = data.getMonth();
+        m = m + 1;
+        var d = data.getDate();
+        var y = data.getFullYear();
+        var now = y + '-' + m + '-' + d;
+        var obj = '{"' + now + '":"今天"}';
+        var obj = JSON.parse(obj);
+        //同时绑定多个
+        lay('.test-item').each(function () {
+            laydate.render({
+                elem: this
+                , type: 'date'
+                , trigger: 'click'
+                , btns: ['now']
+                , mark: obj
+                , done: function (value, date) {
+                    $('.lay-btn-diy').click();
+                }
+            });
+        });
+
+        @stack('dataTableJS')
+            g.currentDataTable = table;
+
+        var _dataTableReload = {
+            reload: function () {
+                //执行重载
+                table.reload('{{ $dataId }}', {
+                    page: {
+                        curr: 1 //重新从第 1 页开始
+                    }
+                    , where: initLoadWhere()
+                });
+            }
+        };
+        g.currentDataTableReload = _dataTableReload;
+        $('*[eventType=event-query-submit]').on('click', function () {
+            $('*[eventType=eventForm]').submit();
+            // _dataTableReload['reload'] ? _dataTableReload['reload'].call(this) : '';
+        });
+
+        function tableReload(obj) {
+            _dataTableReload['reload'] ? _dataTableReload['reload'].call(null) : '';
+        }
+
+    });
+
+
+</script>

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff