Jimy 6 жил өмнө
parent
commit
bdf4334f80

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

@@ -214,7 +214,7 @@ class SportsBaseController extends Controller {
             }
 
             //查看赛事是否有下注细信息
-            $res = \App\Models\MoneyBuyMatch::where('match_id', $data->match_id)->get();
+            $res = \App\Models\MoneyBuyMatch::where('match_id', $data->match_id)->get()->toArray();
             if(!empty($res)){
                 if($data->status == 0){
                     $match_status =array(['status'=>0,'name'=>'未开始'],['status'=>1,'name'=>'正在进行'],['status'=>4,'name'=>'作废']);

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

@@ -215,7 +215,7 @@ class SportsBasketController extends Controller {
 				return -2;
 			}
 			//查看赛事是否有下注细信息
-			$res = \App\Models\MoneyBuyMatch::where('match_id', $data->match_id)->get();
+			$res = \App\Models\MoneyBuyMatch::where('match_id', $data->match_id)->get()->toArray();
 			if(!empty($res)){
 				if($data->status == 0){
 					$match_status =array(['status'=>0,'name'=>'未开始'],['status'=>1,'name'=>'正在进行'],['status'=>4,'name'=>'作废']);

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

@@ -213,7 +213,7 @@ class SportsSoccerController extends Controller {
             }
 
             //查看赛事是否有下注细信息
-            $res = \App\Models\MoneyBuyMatch::where('match_id', $data->match_id)->get();
+            $res = \App\Models\MoneyBuyMatch::where('match_id', $data->match_id)->get()->toArray();
             if(!empty($res)){
                 if($data->status == 0){
                     $match_status =array(['status'=>0,'name'=>'未开始'],['status'=>1,'name'=>'正在进行'],['status'=>4,'name'=>'作废']);

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

@@ -168,7 +168,7 @@ class SportsTennisController extends Controller {
             $data['parents'] = $parents;
             $data['country'] = $country;
             $data['countrys'] = $countrys;
-            return view('sports.Tennis_form', $data);
+            return view('sports.tennis_form', $data);
         } else {
             $model = new \App\Models\SportsTennis();
             $model->home_team = $req->input('home_team');
@@ -215,7 +215,7 @@ class SportsTennisController extends Controller {
             }
 
             //查看赛事是否有下注细信息
-            $res = \App\Models\MoneyBuyMatch::where('match_id', $data->match_id)->get();
+            $res = \App\Models\MoneyBuyMatch::where('match_id', $data->match_id)->get()->toArray();
             if(!empty($res)){
                 if($data->status == 0){
                     $match_status =array(['status'=>0,'name'=>'未开始'],['status'=>1,'name'=>'正在进行'],['status'=>4,'name'=>'作废']);
@@ -265,7 +265,7 @@ class SportsTennisController extends Controller {
                 }
             }
 
-            return view('sports.Tennis_form', $data);
+            return view('sports.tennis_form', $data);
         } else {
             $model = new \App\Models\SportsTennis();
             $model->id = $req->input('id');

+ 8 - 53
app/Models/SportsBase.php

@@ -13,37 +13,15 @@ class SportsBase extends BaseModel {
 
     function getinfo($list = 10, $page, $where = '',$orwhere = '')
     {
-        $bqmatch = $this->get();
+        $bqmatch = $this->where('status','<','2')->where('match_date','<=',date("Y-m-d",time()))->get();
         for($b=0;$b<count($bqmatch);$b++){
-            if($bqmatch[$b]->status == 0 || $bqmatch[$b]->status == 1){
-                if($bqmatch[$b]->match_date < date("Y-m-d",time()) && strtotime($bqmatch[$b]->match_time.' '.$bqmatch[$b]->match_time)+10800 < time()){
-                    \App\Models\SportsBase::where('match_id',$bqmatch[$b]->match_id)->update(['status'=>'2']);
-                    \App\Models\Stbqresultrecord::where('match_id',$bqmatch[$b]->match_id)->update(['status'=>'2']);
-//                    $comendnotice = \App\Model\Comendnotice::where('match_id',$bqmatch[$b]->match_id)->first();
-//                    if(empty($comendnotice)){
-//                        $db = new \App\Model\Comendnotice();
-//                        $db->status = 0;
-//                        $db->game_code = 'bq';
-//                        $db->match_id = $bqmatch[$b]->match_id;
-//                        $db->done_time = date("Y-m-d h:i:s", time());
-//                        $db->ctime = date("Y-m-d h:i:s", time());
-//                        $db->save();
-//                    }
-                }
-                if($bqmatch[$b]->match_date == date("Y-m-d",time()) && strtotime($bqmatch[$b]->match_date.' '.$bqmatch[$b]->match_time)+10800 < time()){
-                    \App\Models\SportsBase::where('match_id',$bqmatch[$b]->match_id)->update(['status'=>'2']);
-                    \App\Models\Stbqresultrecord::where('match_id',$bqmatch[$b]->match_id)->update(['status'=>'2']);
-//                    $comendnotice = \App\Model\Comendnotice::where('match_id',$bqmatch[$b]->match_id)->first();
-//                    if(empty($comendnotice)){
-//                        $db = new \App\Model\Comendnotice();
-//                        $db->status = 0;
-//                        $db->game_code = 'bq';
-//                        $db->match_id = $bqmatch[$b]->match_id;
-//                        $db->done_time = date("Y-m-d h:i:s", time());
-//                        $db->ctime = date("Y-m-d h:i:s", time());
-//                        $db->save();
-//                    }
-                }
+            if($bqmatch[$b]->match_date < date("Y-m-d",time()) && strtotime($bqmatch[$b]->match_time.' '.$bqmatch[$b]->match_time)+10800 < time()){
+                \App\Models\SportsBase::where('match_id',$bqmatch[$b]->match_id)->update(['status'=>'2']);
+                \App\Models\Stbqresultrecord::where('match_id',$bqmatch[$b]->match_id)->update(['status'=>'2']);
+            }
+            if($bqmatch[$b]->match_date == date("Y-m-d",time()) && strtotime($bqmatch[$b]->match_date.' '.$bqmatch[$b]->match_time)+10800 < time()){
+                \App\Models\SportsBase::where('match_id',$bqmatch[$b]->match_id)->update(['status'=>'2']);
+                \App\Models\Stbqresultrecord::where('match_id',$bqmatch[$b]->match_id)->update(['status'=>'2']);
             }
         }
         
@@ -96,9 +74,6 @@ class SportsBase extends BaseModel {
             return -2021052003; //
         }
 
-        //赛事结果处理状态查询
-        $result = \App\Models\Comendnotice::where('game_code','bq')->get();
-
         for($i=0;$i<count($data);$i++){
 
             if($data[$i]->match_date == '' && $data[$i]->last_time != ''){
@@ -129,26 +104,6 @@ class SportsBase extends BaseModel {
                 $data[$i]->home_guest = $data[$i]->home_team.' VS '.$data[$i]->guest_team;
             }
 
-            //赛事结果状态
-            $data[$i]->result_status = -1;
-            $data[$i]->result_id = -1;
-            if(!empty($result)){
-                for($j=0;$j<count($result);$j++){
-                    if($data[$i]->match_id == $result[$j]->match_id){
-                        $data[$i]->result_status = $result[$j]->status;
-                        $data[$i]->result_id = $result[$j]->id;
-                    }
-                }
-            }
-            if($data[$i]->result_status != -1){
-                if($data[$i]->result_status == 0){
-                    $data[$i]->result = '<a class="layui-btn layui-btn-sm dealwith" lay-event="detail" pid="id" uri="/admin/SportsBase/dealwith/?id=" href="javascript:dealwith(\'/admin/SportsBase/dealwith/?id='.$data[$i]->result_id.'\');" style="background-color: #FF5722;"> 处理 </a>';
-                }else{
-                    $data[$i]->result = '<a class="layui-btn layui-btn-sm dealwith" lay-event="detail" pid="id" uri="" href="javascript:void(0)" style="background-color: #FFAF60;"> 已处理 </a>';
-                }
-            }else{
-                $data[$i]->result = '<a class="layui-btn layui-btn-sm audit" lay-event="detail" pid="id" uri="" href="javascript:void(0)" style="background-color: grey;"> 处理 </a>';
-            }
         }
         return $data->toArray();
 

+ 8 - 53
app/Models/SportsBasket.php

@@ -13,37 +13,15 @@ class SportsBasket extends BaseModel {
 
     function getinfo($list = 10, $page, $where = '',$orwhere = '')
     {
-        $lqmatch = $this->get();
+        $lqmatch = $this->where('status','<','2')->where('match_date','<=',date("Y-m-d",time()))->get();
         for($b=0;$b<count($lqmatch);$b++){
-            if($lqmatch[$b]->status == 0 || $lqmatch[$b]->status == 1){
-                if($lqmatch[$b]->match_date < date("Y-m-d",time()) && strtotime($lqmatch[$b]->match_time.' '.$lqmatch[$b]->match_time)+4200 < time()){
-                    \App\Models\SportsBasket::where('id',$lqmatch[$b]->id)->update(['status'=>'2']);
-                    \App\Models\Stlqresultrecord::where('match_id',$lqmatch[$b]->match_id)->update(['status'=>'2']);
-//                    $comendnotice = \App\Model\Comendnotice::where('match_id',$lqmatch[$b]->match_id)->first();
-//                    if(empty($comendnotice)){
-//                        $db = new \App\Model\Comendnotice();
-//                        $db->status = 0;
-//                        $db->game_code = 'lq';
-//                        $db->match_id = $lqmatch[$b]->match_id;
-//                        $db->done_time = date("Y-m-d h:i:s", time());
-//                        $db->ctime = date("Y-m-d h:i:s", time());
-//                        $db->save();
-//                    }
-                }
-                if($lqmatch[$b]->match_date == date("Y-m-d",time()) && strtotime($lqmatch[$b]->match_date.' '.$lqmatch[$b]->match_time)+4200 < time()){
-                    \App\Models\SportsBasket::where('id',$lqmatch[$b]->id)->update(['status'=>'2']);
-                    \App\Models\Stlqresultrecord::where('match_id',$lqmatch[$b]->match_id)->update(['status'=>'2']);
-//                    $comendnotice = \App\Model\Comendnotice::where('match_id',$lqmatch[$b]->match_id)->first();
-//                    if(empty($comendnotice)){
-//                        $db = new \App\Model\Comendnotice();
-//                        $db->status = 0;
-//                        $db->game_code = 'lq';
-//                        $db->match_id = $lqmatch[$b]->match_id;
-//                        $db->done_time = date("Y-m-d h:i:s", time());
-//                        $db->ctime = date("Y-m-d h:i:s", time());
-//                        $db->save();
-//                    }
-                }
+            if($lqmatch[$b]->match_date < date("Y-m-d",time()) && strtotime($lqmatch[$b]->match_time.' '.$lqmatch[$b]->match_time)+4200 < time()){
+                \App\Models\SportsBasket::where('id',$lqmatch[$b]->id)->update(['status'=>'2']);
+                \App\Models\Stlqresultrecord::where('match_id',$lqmatch[$b]->match_id)->update(['status'=>'2']);
+            }
+            if($lqmatch[$b]->match_date == date("Y-m-d",time()) && strtotime($lqmatch[$b]->match_date.' '.$lqmatch[$b]->match_time)+4200 < time()){
+                \App\Models\SportsBasket::where('id',$lqmatch[$b]->id)->update(['status'=>'2']);
+                \App\Models\Stlqresultrecord::where('match_id',$lqmatch[$b]->match_id)->update(['status'=>'2']);
             }
         }
 
@@ -96,9 +74,6 @@ class SportsBasket extends BaseModel {
             return -2021052003; //
         }
 
-        //赛事结果处理状态查询
-        $result = \App\Models\Comendnotice::where('game_code','lq')->get();
-
         for($i=0;$i<count($data);$i++){
 
             if($data[$i]->match_date == '' && $data[$i]->last_time != ''){
@@ -129,26 +104,6 @@ class SportsBasket extends BaseModel {
                 $data[$i]->home_guest = $data[$i]->home_team.' VS '.$data[$i]->guest_team;
             }
 
-            //赛事结果状态
-            $data[$i]->result_status = -1;
-            $data[$i]->result_id = -1;
-            if(!empty($result)){
-                for($j=0;$j<count($result);$j++){
-                    if($data[$i]->match_id == $result[$j]->match_id){
-                        $data[$i]->result_status = $result[$j]->status;
-                        $data[$i]->result_id = $result[$j]->id;
-                    }
-                }
-            }
-            if($data[$i]->result_status != -1){
-                if($data[$i]->result_status == 0){
-                    $data[$i]->result = '<a class="layui-btn layui-btn-sm dealwith" lay-event="detail" pid="id" uri="/admin/SportsBasket/dealwith/?id=" href="javascript:dealwith(\'/admin/SportsBasket/dealwith/?id='.$data[$i]->result_id.'\');" style="background-color: #FF5722;"> 处理 </a>';
-                }else{
-                    $data[$i]->result = '<a class="layui-btn layui-btn-sm dealwith" lay-event="detail" pid="id" uri="" href="javascript:void(0)" style="background-color: #FFAF60;"> 已处理 </a>';
-                }
-            }else{
-                $data[$i]->result = '<a class="layui-btn layui-btn-sm audit" lay-event="detail" pid="id" uri="" href="javascript:void(0)" style="background-color: grey;"> 处理 </a>';
-            }
         }
         return $data->toArray();
     }

+ 8 - 53
app/Models/SportsSoccer.php

@@ -13,37 +13,15 @@ class SportsSoccer extends BaseModel {
 
     function getinfo($list = 10, $page, $where = '',$orwhere = '')
     {
-        $zqmatch = $this->get();
+        $zqmatch = $this->where('status','<','2')->where('match_date','<=',date("Y-m-d",time()))->get();
         for($b=0;$b<count($zqmatch);$b++){
-            if($zqmatch[$b]->status == 0 || $zqmatch[$b]->status == 1){
-                if($zqmatch[$b]->match_date < date("Y-m-d",time()) && strtotime($zqmatch[$b]->match_time.' '.$zqmatch[$b]->match_time)+7200 < time()){
-                    \App\Models\SportsSoccer::where('id',$zqmatch[$b]->id)->update(['status'=>'2']);
-                    \App\Models\Stzqresultrecord::where('match_id',$zqmatch[$b]->match_id)->update(['status'=>'2']);
-//                    $comendnotice = \App\Model\Comendnotice::where('match_id',$zqmatch[$b]->match_id)->first();
-//                    if(empty($comendnotice)){
-//                        $db = new \App\Model\Comendnotice();
-//                        $db->status = 0;
-//                        $db->game_code = 'zq';
-//                        $db->match_id = $zqmatch[$b]->match_id;
-//                        $db->done_time = date("Y-m-d h:i:s", time());
-//                        $db->ctime = date("Y-m-d h:i:s", time());
-//                        $db->save();
-//                    }
-                }
-                if($zqmatch[$b]->match_date == date("Y-m-d",time()) && strtotime($zqmatch[$b]->match_date.' '.$zqmatch[$b]->match_time)+7200 < time()){
-                    \App\Models\SportsSoccer::where('id',$zqmatch[$b]->id)->update(['status'=>'2']);
-                    \App\Models\Stzqresultrecord::where('match_id',$zqmatch[$b]->match_id)->update(['status'=>'2']);
-//                    $comendnotice = \App\Model\Comendnotice::where('match_id',$zqmatch[$b]->match_id)->first();
-//                    if(empty($comendnotice)){
-//                        $db = new \App\Model\Comendnotice();
-//                        $db->status = 0;
-//                        $db->game_code = 'zq';
-//                        $db->match_id = $zqmatch[$b]->match_id;
-//                        $db->done_time = date("Y-m-d h:i:s", time());
-//                        $db->ctime = date("Y-m-d h:i:s", time());
-//                        $db->save();
-//                    }
-                }
+            if($zqmatch[$b]->match_date < date("Y-m-d",time()) && strtotime($zqmatch[$b]->match_time.' '.$zqmatch[$b]->match_time)+7200 < time()){
+                \App\Models\SportsSoccer::where('id',$zqmatch[$b]->id)->update(['status'=>'2']);
+                \App\Models\Stzqresultrecord::where('match_id',$zqmatch[$b]->match_id)->update(['status'=>'2']);
+            }
+            if($zqmatch[$b]->match_date == date("Y-m-d",time()) && strtotime($zqmatch[$b]->match_date.' '.$zqmatch[$b]->match_time)+7200 < time()){
+                \App\Models\SportsSoccer::where('id',$zqmatch[$b]->id)->update(['status'=>'2']);
+                \App\Models\Stzqresultrecord::where('match_id',$zqmatch[$b]->match_id)->update(['status'=>'2']);
             }
         }
         
@@ -96,9 +74,6 @@ class SportsSoccer extends BaseModel {
             return -2021052003; //
         }
 
-        //赛事结果处理状态查询
-        $result = \App\Models\Comendnotice::where('game_code','zq')->get();
-
         for($i=0;$i<count($data);$i++){
 
             if($data[$i]->match_date == '' && $data[$i]->last_time != ''){
@@ -129,26 +104,6 @@ class SportsSoccer extends BaseModel {
                 $data[$i]->home_guest = $data[$i]->home_team.' VS '.$data[$i]->guest_team;
             }
 
-            //赛事结果状态
-            $data[$i]->result_status = -1;
-            $data[$i]->result_id = -1;
-            if(!empty($result)){
-                for($j=0;$j<count($result);$j++){
-                    if($data[$i]->match_id == $result[$j]->match_id){
-                        $data[$i]->result_status = $result[$j]->status;
-                        $data[$i]->result_id = $result[$j]->id;
-                    }
-                }
-            }
-            if($data[$i]->result_status != -1){
-                if($data[$i]->result_status == 0){
-                    $data[$i]->result = '<a class="layui-btn layui-btn-sm dealwith" lay-event="detail" pid="id" uri="/admin/SportsSoccer/dealwith/?id=" href="javascript:dealwith(\'/admin/SportsSoccer/dealwith/?id='.$data[$i]->result_id.'\');" style="background-color: #FF5722;"> 处理 </a>';
-                }else{
-                    $data[$i]->result = '<a class="layui-btn layui-btn-sm dealwith" lay-event="detail" pid="id" uri="" href="javascript:void(0)" style="background-color: #FFAF60;"> 已处理 </a>';
-                }
-            }else{
-                $data[$i]->result = '<a class="layui-btn layui-btn-sm audit" lay-event="detail" pid="id" uri="" href="javascript:void(0)" style="background-color: grey;"> 处理 </a>';
-            }
         }
         return $data->toArray();
     }

+ 8 - 53
app/Models/SportsTennis.php

@@ -13,37 +13,15 @@ class SportsTennis extends BaseModel {
 
     function getinfo($list = 10, $page, $where = '',$orwhere = '')
     {
-        $wqmatch = $this->get();
+        $wqmatch = $this->where('status','<','2')->where('match_date','<=',date("Y-m-d",time()))->get();
         for($b=0;$b<count($wqmatch);$b++){
-            if($wqmatch[$b]->status == 0 || $wqmatch[$b]->status == 1){
-                if($wqmatch[$b]->match_date < date("Y-m-d",time()) && strtotime($wqmatch[$b]->match_time.' '.$wqmatch[$b]->match_time)+10800 < time()){
-                    \App\Models\SportsTennis::where('match_id',$wqmatch[$b]->match_id)->update(['status'=>'2']);
-                    \App\Models\Stwqresultrecord::where('match_id',$wqmatch[$b]->match_id)->update(['status'=>'2']);
-//                    $comendnotice = \App\Model\Comendnotice::where('match_id',$wqmatch[$b]->match_id)->first();
-//                    if(empty($comendnotice)){
-//                        $db = new \App\Model\Comendnotice();
-//                        $db->status = 0;
-//                        $db->game_code = 'wq';
-//                        $db->match_id = $wqmatch[$b]->match_id;
-//                        $db->done_time = date("Y-m-d h:i:s", time());
-//                        $db->ctime = date("Y-m-d h:i:s", time());
-//                        $db->save();
-//                    }
-                }
-                if($wqmatch[$b]->match_date == date("Y-m-d",time()) && strtotime($wqmatch[$b]->match_date.' '.$wqmatch[$b]->match_time)+10800 < time()){
-                    \App\Models\SportsTennis::where('match_id',$wqmatch[$b]->match_id)->update(['status'=>'2']);
-                    \App\Models\Stwqresultrecord::where('match_id',$wqmatch[$b]->match_id)->update(['status'=>'2']);
-//                    $comendnotice = \App\Model\Comendnotice::where('match_id',$wqmatch[$b]->match_id)->first();
-//                    if(empty($comendnotice)){
-//                        $db = new \App\Model\Comendnotice();
-//                        $db->status = 0;
-//                        $db->game_code = 'wq';
-//                        $db->match_id = $wqmatch[$b]->match_id;
-//                        $db->done_time = date("Y-m-d h:i:s", time());
-//                        $db->ctime = date("Y-m-d h:i:s", time());
-//                        $db->save();
-//                    }
-                }
+            if($wqmatch[$b]->match_date < date("Y-m-d",time()) && strtotime($wqmatch[$b]->match_time.' '.$wqmatch[$b]->match_time)+10800 < time()){
+                \App\Models\SportsTennis::where('match_id',$wqmatch[$b]->match_id)->update(['status'=>'2']);
+                \App\Models\Stwqresultrecord::where('match_id',$wqmatch[$b]->match_id)->update(['status'=>'2']);
+            }
+            if($wqmatch[$b]->match_date == date("Y-m-d",time()) && strtotime($wqmatch[$b]->match_date.' '.$wqmatch[$b]->match_time)+10800 < time()){
+                \App\Models\SportsTennis::where('match_id',$wqmatch[$b]->match_id)->update(['status'=>'2']);
+                \App\Models\Stwqresultrecord::where('match_id',$wqmatch[$b]->match_id)->update(['status'=>'2']);
             }
         }
         
@@ -96,9 +74,6 @@ class SportsTennis extends BaseModel {
             return -2021052003; //
         }
 
-        //赛事结果处理状态查询
-        $result = \App\Models\Comendnotice::where('game_code','wq')->get();
-
         for($i=0;$i<count($data);$i++){
 
             if($data[$i]->match_date == '' && $data[$i]->last_time != ''){
@@ -129,26 +104,6 @@ class SportsTennis extends BaseModel {
                 $data[$i]->home_guest = $data[$i]->home_team.' VS '.$data[$i]->guest_team;
             }
 
-            //赛事结果状态
-            $data[$i]->result_status = -1;
-            $data[$i]->result_id = -1;
-            if(!empty($result)){
-                for($j=0;$j<count($result);$j++){
-                    if($data[$i]->match_id == $result[$j]->match_id){
-                        $data[$i]->result_status = $result[$j]->status;
-                        $data[$i]->result_id = $result[$j]->id;
-                    }
-                }
-            }
-            if($data[$i]->result_status != -1){
-                if($data[$i]->result_status == 0){
-                    $data[$i]->result = '<a class="layui-btn layui-btn-sm dealwith" lay-event="detail" pid="id" uri="/admin/SportsTennis/dealwith/?id=" href="javascript:dealwith(\'/admin/SportsTennis/dealwith/?id='.$data[$i]->result_id.'\');" style="background-color: #FF5722;"> 处理 </a>';
-                }else{
-                    $data[$i]->result = '<a class="layui-btn layui-btn-sm dealwith" lay-event="detail" pid="id" uri="" href="javascript:void(0)" style="background-color: #FFAF60;"> 已处理 </a>';
-                }
-            }else{
-                $data[$i]->result = '<a class="layui-btn layui-btn-sm audit" lay-event="detail" pid="id" uri="" href="javascript:void(0)" style="background-color: grey;"> 处理 </a>';
-            }
         }
         return $data->toArray();
 

+ 1 - 1
测试钩子.txt

@@ -1 +1 @@
-12344
+123442dd