|
|
@@ -21,7 +21,16 @@ class SportsSoccerController extends Controller {
|
|
|
$request['recommend'] = isset($req->recommend) ? trim($req->recommend) : '';
|
|
|
$request['status'] = isset($req->status) ? trim($req->status) : '-1';
|
|
|
$request['sureblurs'] = isset($req->sureblurs) ? $req->sureblurs : 'on';
|
|
|
+
|
|
|
+// $source = \App\Models\Setinfo::where('id','1000')->first();
|
|
|
+// if($source->infocontent != '混合数据'){
|
|
|
+// $data = \App\Models\SoccerLeague::join('st_zq_local_league','st_zq_league.id','=','st_zq_local_league.lg_id')->select('st_zq_league.id','st_zq_league.name_chinese')->where('st_zq_local_league.source',$source->infocontent)->get();
|
|
|
+// }else{
|
|
|
+// $data = \App\Models\SoccerLeague::select('id','name_chinese')->get();
|
|
|
+// }
|
|
|
+
|
|
|
$data = \App\Models\SoccerLeague::select('id','lg_id','name_chinese')->get();
|
|
|
+
|
|
|
$request['league'] = $data;
|
|
|
$dt = \App\Lib\DataTable\DataTable::init();
|
|
|
$dt->setDataSource('/admin/SportsSoccer/info');
|
|
|
@@ -30,14 +39,11 @@ class SportsSoccerController extends Controller {
|
|
|
$dt->addColsFields('lg_id', array('templet' => '#userdetail', 'sort' => true, 'width' => 80));
|
|
|
$dt->addColsFields('name_chinese', array('templet' => '#userdetail', 'sort' => false, 'width' => 200));
|
|
|
$dt->addColsFields('home_guest', array('templet' => '#userdetail', 'sort' => false, 'width' => 260));
|
|
|
-// $dt->addColsFields('home_team', array('templet' => '#userdetail', 'sort' => false, 'width' => 130));
|
|
|
-// $dt->addColsFields('guest_team', array('templet' => '#userdetail', 'sort' => false, 'width' => 130));
|
|
|
$dt->addColsFields('match_date', array('templet' => '#userdetail', 'sort' => true, 'width' => 130));
|
|
|
$dt->addColsFields('match_time', array('templet' => '#userdetail', 'sort' => true, 'width' => 130));
|
|
|
$dt->addColsFields('recommend', array('templet' => '#recommend', 'sort' => false, 'width' => 120,'align' => 'center'));
|
|
|
$dt->addColsFields('status', array('templet' => '#userdetail', 'sort' => false, 'width' => 100));
|
|
|
$dt->addColsFields('result', array( 'sort' => false, 'width' => 100));
|
|
|
- //$arr[] = 'view';
|
|
|
if (checkRriv('/admin/SportsSoccer/edit')) {
|
|
|
$arr[] = 'edit';
|
|
|
}
|
|
|
@@ -55,10 +61,6 @@ class SportsSoccerController extends Controller {
|
|
|
$name_chinese = Request::has('name_chinese') ? Request::get('name_chinese') : '';
|
|
|
$home_team = Request::has('home_team') ? Request::get('home_team') : '';
|
|
|
$match_date = Request::has('match_date') ? Request::get('match_date') : '';
|
|
|
- //$match_date = $req->input('match_date');
|
|
|
-// if(!empty($match_date)){
|
|
|
-// return 2;
|
|
|
-// }
|
|
|
$status = Request::has('status') ? Request::get('status') : '';
|
|
|
$sureblur = Request::has('sureblurs') ? Request::get('sureblurs') : 'off';
|
|
|
$where = array();
|
|
|
@@ -75,75 +77,12 @@ 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');
|
|
|
-// $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){
|
|
|
+
|
|
|
+ if(!empty($match_date)){
|
|
|
$where[] = array('st_zq_competition.match_date', '=', $match_date);
|
|
|
}
|
|
|
- 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()));
|
|
|
- }
|
|
|
+ if($status != -1){
|
|
|
+ $where[] = array('st_zq_competition.status', '=', $status);
|
|
|
}
|
|
|
|
|
|
$newapp = new \App\Models\SportsSoccer();
|
|
|
@@ -170,7 +109,15 @@ class SportsSoccerController extends Controller {
|
|
|
*获取所有足球联赛信息
|
|
|
*/
|
|
|
function getParent() {
|
|
|
+// $source = \App\Models\Setinfo::where('id','1000')->first();
|
|
|
+// if($source->infocontent != '混合数据'){
|
|
|
+// $data = \App\Models\SoccerLeague::join('st_zq_local_league','st_zq_league.id','=','st_zq_local_league.lg_id')->select('st_zq_league.id','st_zq_league.name_chinese')->where('st_zq_local_league.source',$source->infocontent)->get();
|
|
|
+// }else{
|
|
|
+// $data = \App\Models\SoccerLeague::select('id','name_chinese')->get();
|
|
|
+// }
|
|
|
+
|
|
|
$data = \App\Models\SoccerLeague::select('id','lg_id','name_chinese')->get();
|
|
|
+
|
|
|
if (!$data) {
|
|
|
return;
|
|
|
}
|
|
|
@@ -222,6 +169,7 @@ class SportsSoccerController extends Controller {
|
|
|
return view('sports.soccer_form', $data);
|
|
|
} else {
|
|
|
$model = new \App\Models\SportsSoccer();
|
|
|
+ // $model->id = $req->input('parent_id');
|
|
|
$model->home_team = $req->input('home_team');
|
|
|
$model->guest_team = $req->input('guest_team');
|
|
|
$model->lg_id = $req->input('parent_id');
|
|
|
@@ -229,6 +177,7 @@ class SportsSoccerController extends Controller {
|
|
|
$model->match_time = $req->input('match_time');
|
|
|
$model->status = $req->input('status');
|
|
|
$model->match_id = time() ;
|
|
|
+ $model->m_match_id = $model->match_id ;
|
|
|
$model->ctime = date('Y-m-d H:i:s',time());
|
|
|
$model->utime = date('Y-m-d H:i:s',time());
|
|
|
$model->tag = mt_rand(0,100) ;
|