|
|
@@ -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();
|
|
|
|