|
|
@@ -73,13 +73,77 @@ class SportsSoccerController extends Controller {
|
|
|
$orwhere[] = array('st_zq_competition.guest_team', '=', $home_team);
|
|
|
}
|
|
|
}
|
|
|
- if (!empty($match_date)) {
|
|
|
-// $where[] = array('st_zq_competition.match_date', '=', '2019-04-13');
|
|
|
+// if (!empty($match_date)) {
|
|
|
+//// $where[] = array('st_zq_competition.match_date', '=', '2019-04-13');
|
|
|
+// $where[] = array('st_zq_competition.match_date', '=', $match_date);
|
|
|
+// }
|
|
|
+// if ($status != -1) {
|
|
|
+// $where[] = array('st_zq_competition.status', '=', $status);
|
|
|
+// }
|
|
|
+ if(!empty($match_date) && $status != -1){
|
|
|
+ if($match_date > date('Y-m-d',time())){
|
|
|
+ if ($status == 0) {
|
|
|
+ $where[] = array('st_zq_competition.match_date', '=', $match_date);
|
|
|
+ }
|
|
|
+ if ($status == 1) {
|
|
|
+ $where[] = array('st_zq_competition.match_date', '<', $match_date);
|
|
|
+ $where[] = array('st_zq_competition.match_date', '>', $match_date);
|
|
|
+ }
|
|
|
+ if ($status == 2) {
|
|
|
+ $where[] = array('st_zq_competition.match_date', '<', $match_date);
|
|
|
+ $where[] = array('st_zq_competition.match_date', '>', $match_date);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if($match_date == date('Y-m-d',time())){
|
|
|
+ if ($status == 0) {
|
|
|
+ $where[] = array('st_zq_competition.match_date', '=', $match_date);
|
|
|
+ $where[] = array('st_zq_competition.match_time', '>', date('H:i:s',time()));
|
|
|
+ }
|
|
|
+ if ($status == 1) {
|
|
|
+ $where[] = array('st_zq_competition.match_date', '=', $match_date);
|
|
|
+ $where[] = array('st_zq_competition.match_time', '<', date('H:i:s',time()));
|
|
|
+ $where[] = array('st_zq_competition.match_time', '>', date('H:i:s',time()-5400));
|
|
|
+ }
|
|
|
+ if ($status == 2) {
|
|
|
+ $where[] = array('st_zq_competition.match_date', '=', $match_date);
|
|
|
+ $where[] = array('st_zq_competition.match_time', '<', date('H:i:s',time()-5400));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if($match_date < date('Y-m-d',time())){
|
|
|
+ if ($status == 0) {
|
|
|
+ $where[] = array('st_zq_competition.match_date', '<', $match_date);
|
|
|
+ $where[] = array('st_zq_competition.match_date', '>', $match_date);
|
|
|
+ }
|
|
|
+ if ($status == 1) {
|
|
|
+ $where[] = array('st_zq_competition.match_date', '<', $match_date);
|
|
|
+ $where[] = array('st_zq_competition.match_date', '>', $match_date);
|
|
|
+ }
|
|
|
+ if ($status == 2) {
|
|
|
+ $where[] = array('st_zq_competition.match_date', '=', $match_date);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!empty($match_date) && $status == -1){
|
|
|
$where[] = array('st_zq_competition.match_date', '=', $match_date);
|
|
|
}
|
|
|
- if ($status != -1) {
|
|
|
- $where[] = array('st_zq_competition.status', '=', $status);
|
|
|
+ if(empty($match_date) && $status != -1){
|
|
|
+ if ($status == 0) {
|
|
|
+ $where[] = array('st_zq_competition.match_date', '=', date('Y-m-d',time()));
|
|
|
+ $where[] = array('st_zq_competition.match_time', '>', date('H:i:s',time()));
|
|
|
+ $orwhere[] = array('st_zq_competition.match_date', '>', date('Y-m-d',time()));
|
|
|
+ }
|
|
|
+ if ($status == 1) {
|
|
|
+ $where[] = array('st_zq_competition.match_date', '=', date('Y-m-d',time()));
|
|
|
+ $where[] = array('st_zq_competition.match_time', '<', date('H:i:s',time()));
|
|
|
+ $where[] = array('st_zq_competition.match_time', '>', date('H:i:s',time()-5400));
|
|
|
+ }
|
|
|
+ if ($status == 2) {
|
|
|
+ $where[] = array('st_zq_competition.match_date', '=', date('Y-m-d',time()));
|
|
|
+ $where[] = array('st_zq_competition.match_time', '<', date('H:i:s',time()-5400));
|
|
|
+ $orwhere[] = array('st_zq_competition.match_date', '<', date('Y-m-d',time()));
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
$newapp = new \App\Models\SportsSoccer();
|
|
|
$data = $newapp->getinfo($list, $page, $where,$orwhere);
|
|
|
return \App\Lib\DataTable\DataTable::init()->toJson($data['data'], $data['total']);
|