|
|
@@ -15,7 +15,6 @@ use Request;
|
|
|
class SportsSoccerController extends Controller {
|
|
|
|
|
|
public function score(Req $req) {
|
|
|
- //$request['name_chinese'] = isset($req->name_chinese) ? trim($req->name_chinese) : '-1';
|
|
|
$request['name_chinese'] = isset($req->name_chinese) ? trim($req->name_chinese) : '';
|
|
|
$request['home_team'] = isset($req->home_team) ? trim($req->home_team) : null;
|
|
|
$request['match_date'] = isset($req->match_date) ? trim($req->match_date) : null;
|
|
|
@@ -37,8 +36,6 @@ class SportsSoccerController extends Controller {
|
|
|
$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');
|
|
|
@@ -51,7 +48,6 @@ class SportsSoccerController extends Controller {
|
|
|
$dt->addColsFields('match_time', array('templet' => '#userdetail', 'sort' => true, 'width' => 100));
|
|
|
$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));
|
|
|
if (checkRriv('/admin/SportsSoccer/edit')) {
|
|
|
$arr[] = 'edit';
|
|
|
}
|
|
|
@@ -75,9 +71,6 @@ class SportsSoccerController extends Controller {
|
|
|
$sureblur = Request::has('sureblurs') ? Request::get('sureblurs') : 'off';
|
|
|
$where = array();
|
|
|
$orwhere = array();
|
|
|
-// if (!empty($name_chinese) && $name_chinese!=-1) {
|
|
|
-// $where[] = array('st_zq_league.name_chinese', '=', $name_chinese);
|
|
|
-// }
|
|
|
if (!empty($name_chinese)) {
|
|
|
if (empty($sureblur) || $sureblur == 'off') {
|
|
|
$where[] = array('st_zq_league.name_chinese', 'like', '%' . $name_chinese . '%');
|
|
|
@@ -109,9 +102,6 @@ class SportsSoccerController extends Controller {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// if(!empty($match_date)){
|
|
|
-// $where[] = array('st_zq_competition.match_date', '=', $match_date);
|
|
|
-// }
|
|
|
if($status != -1){
|
|
|
$where[] = array('st_zq_competition.status', '=', $status);
|
|
|
}
|
|
|
@@ -147,8 +137,6 @@ class SportsSoccerController extends Controller {
|
|
|
$data = \App\Models\SoccerLeague::select('id','name_chinese')->get();
|
|
|
}
|
|
|
|
|
|
-// $data = \App\Models\SoccerLeague::select('id','lg_id','name_chinese')->get();
|
|
|
-
|
|
|
if (!$data) {
|
|
|
return;
|
|
|
}
|
|
|
@@ -305,15 +293,13 @@ class SportsSoccerController extends Controller {
|
|
|
|
|
|
$data['match_status'] = $match_status;
|
|
|
|
|
|
-
|
|
|
- //$lange = trans('menu');
|
|
|
foreach ($data['parents'] as $k => $v) {
|
|
|
$arr = trim($data['parents'][$k]['name_chinese']);
|
|
|
if (isset($lange[$arr])) {
|
|
|
$data['parents'][$k]['name_chinese']=$lange[$arr];
|
|
|
}
|
|
|
}
|
|
|
-// var_dump($data);die;
|
|
|
+
|
|
|
return view('sports.soccer_form', $data);
|
|
|
} else {
|
|
|
$model = new \App\Models\SportsSoccer();
|
|
|
@@ -364,11 +350,11 @@ class SportsSoccerController extends Controller {
|
|
|
public function delete(Req $req) {
|
|
|
$id = $req->input('id');
|
|
|
if (empty($id)) {
|
|
|
- return responseToJson(-2001); //id������
|
|
|
+ return responseToJson(-2001);
|
|
|
}
|
|
|
$ids = explode(',', $id);
|
|
|
if (!is_array($ids) && intval($ids) < 0) {
|
|
|
- return responseToJson(-2002); //id����
|
|
|
+ return responseToJson(-2002);
|
|
|
}
|
|
|
$id = array();
|
|
|
$localmatch = \App\Models\Stzqlocalmatch::get();
|
|
|
@@ -388,15 +374,15 @@ class SportsSoccerController extends Controller {
|
|
|
|
|
|
$rows = \App\Models\SportsSoccer::whereIn('id', $ids)->delete();
|
|
|
if (!$rows) {
|
|
|
- return responseToJson(-2003); //id����
|
|
|
+ return responseToJson(-2003);
|
|
|
}
|
|
|
if(count($id)>0) {
|
|
|
$row = \App\Models\Stzqlocalmatch::whereIn('id', $id)->delete();
|
|
|
if (!$row) {
|
|
|
- return responseToJson(-2003); //id????
|
|
|
+ return responseToJson(-2003);
|
|
|
}
|
|
|
}
|
|
|
- return responseToJson(1, trans('menu.delete_success')); //id����
|
|
|
+ return responseToJson(1, trans('menu.delete_success'));
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -409,7 +395,7 @@ class SportsSoccerController extends Controller {
|
|
|
if (intval($id) < 1) {
|
|
|
return -1;
|
|
|
}
|
|
|
- //return $id;
|
|
|
+
|
|
|
$SettlementWinFail = new SettlementWinFail();
|
|
|
$data = $SettlementWinFail->doRun($id);
|
|
|
return $data;
|
|
|
@@ -422,7 +408,7 @@ class SportsSoccerController extends Controller {
|
|
|
$request['p_code'] = isset($req->p_code) ? trim($req->p_code) : '-1';
|
|
|
$request['id'] = isset($req->id) ? trim($req->id) : null;
|
|
|
$newapp = \App\Models\SportsSoccer::where('id',$request['id'])->first();
|
|
|
- // $match_id = $newapp->match_id;
|
|
|
+
|
|
|
if(empty($newapp)){
|
|
|
$match_id = $req->input('id');
|
|
|
}else{
|
|
|
@@ -430,7 +416,7 @@ class SportsSoccerController extends Controller {
|
|
|
}
|
|
|
$request['match_id'] = isset($match_id) ? trim($match_id) : null;
|
|
|
$data = \App\Models\Matchcode::where('p_id','0')->where('game_code','zq')->get();
|
|
|
- //$data = \App\Model\Matchcode::where('p_id','0')->get();
|
|
|
+
|
|
|
$request['pcode'] = $data;
|
|
|
$dt = \App\Lib\DataTable\DataTable::init();
|
|
|
$dt->setDataSource('/admin/SportsSoccer/oddsinfo?match_id='.$match_id.'');
|
|
|
@@ -440,7 +426,6 @@ class SportsSoccerController extends Controller {
|
|
|
$dt->addColsFields('odds_code_cn', array('templet' => '#userdetail', 'sort' => false, 'width' => 200));
|
|
|
$dt->addColsFields('condition', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
|
|
|
$dt->addColsFields('odds', array('templet' => '#userdetail', 'sort' => false, 'width' => 80));
|
|
|
-// $dt->addColsFields('p_id', array('templet' => '#userdetail', 'sort' => false, 'width' => 100));
|
|
|
$dt->addColsFields('p_code_cn', array('templet' => '#userdetail', 'sort' => false, 'width' => 120));
|
|
|
$dt->addColsFields('max', array('templet' => '#userdetail', 'sort' => false, 'width' => 100));
|
|
|
$dt->addColsFields('min', array('templet' => '#userdetail', 'sort' => false, 'width' => 100));
|
|
|
@@ -502,7 +487,6 @@ class SportsSoccerController extends Controller {
|
|
|
*/
|
|
|
function addodds(Req $req) {
|
|
|
$pcodedata = \App\Models\Matchcode::where('p_id','0')->where('game_code','zq')->get();
|
|
|
- //$pcodedata = \App\Model\Matchcode::where('p_id','0')->get();
|
|
|
for($i=0;$i<count($pcodedata);$i++){
|
|
|
$pcodedata[$i]->p_code = $pcodedata[$i]->odds_code;
|
|
|
}
|
|
|
@@ -576,7 +560,6 @@ class SportsSoccerController extends Controller {
|
|
|
function oddsedit(Req $req) {
|
|
|
$lange = trans('sportsoddscode');
|
|
|
$pcodedata = \App\Models\Matchcode::where('p_id','0')->where('game_code','zq')->get();
|
|
|
- //$pcodedata = \App\Model\Matchcode::where('p_id','0')->get();
|
|
|
for($i=0;$i<count($pcodedata);$i++){
|
|
|
$pcodedata[$i]->p_code = $pcodedata[$i]->odds_code;
|
|
|
}
|
|
|
@@ -626,7 +609,6 @@ class SportsSoccerController extends Controller {
|
|
|
$data = $data->toArray();
|
|
|
|
|
|
$data['pcode'] = $pcodedata;
|
|
|
- //$data['code'] = $codedata;
|
|
|
|
|
|
return view('sports.soccer_odds_form', $data);
|
|
|
} else {
|
|
|
@@ -634,9 +616,7 @@ class SportsSoccerController extends Controller {
|
|
|
$data = new \App\Models\SoccerOddsRecord();
|
|
|
$model->id = $req->input('id');
|
|
|
$model = $model::find($model->id);
|
|
|
- //$model->odds_code = $req->input('code');
|
|
|
$model->status = $req->input('status');
|
|
|
- //$model->p_code = $req->input('pcode');
|
|
|
$model->odds = $req->input('odds');
|
|
|
$model->condition = $req->input('condition');
|
|
|
$model->max = $req->input('max');
|
|
|
@@ -648,9 +628,7 @@ class SportsSoccerController extends Controller {
|
|
|
|
|
|
$result = \App\Models\SoccerOdds::where('id',$model->id)->first();
|
|
|
$data->match_id = $result->match_id;
|
|
|
- //$data->odds_code = $model->odds_code;
|
|
|
$data->status = $model->status;
|
|
|
- //$data->p_code = $model->p_code;
|
|
|
$data->p_id = $result->p_id;
|
|
|
$record = \App\Models\SoccerOddsRecord::where('match_id',$data->match_id)->where('odds_code',$result->odds_code)->where('p_id',$result->p_id)->orderby('utime','desc')->first();
|
|
|
if(!empty($record)){
|
|
|
@@ -681,11 +659,11 @@ class SportsSoccerController extends Controller {
|
|
|
public function oddsdelete(Req $req) {
|
|
|
$id = $req->input('id');
|
|
|
if (empty($id)) {
|
|
|
- return responseToJson(-2001); //id������
|
|
|
+ return responseToJson(-2001);
|
|
|
}
|
|
|
$ids = explode(',', $id);
|
|
|
if (!is_array($ids) && intval($ids) < 0) {
|
|
|
- return responseToJson(-2002); //id����
|
|
|
+ return responseToJson(-2002);
|
|
|
}
|
|
|
if (is_array($ids) && count($ids) > 0) {
|
|
|
foreach ($ids as $k => $v) {
|
|
|
@@ -697,9 +675,9 @@ class SportsSoccerController extends Controller {
|
|
|
|
|
|
$rows = \App\Models\SoccerOdds::whereIn('id', $ids)->delete();
|
|
|
if (!$rows) {
|
|
|
- return responseToJson(-2003); //id����
|
|
|
+ return responseToJson(-2003);
|
|
|
}
|
|
|
- return responseToJson(1, trans('menu.delete_success')); //id����
|
|
|
+ return responseToJson(1, trans('menu.delete_success'));
|
|
|
|
|
|
}
|
|
|
}
|