|
@@ -12,7 +12,7 @@ use Request;
|
|
|
*
|
|
*
|
|
|
*/
|
|
*/
|
|
|
class SportsbkController extends Controller {
|
|
class SportsbkController extends Controller {
|
|
|
-
|
|
|
|
|
|
|
+ //篮球结果列表
|
|
|
public function outcome(Req $req) {
|
|
public function outcome(Req $req) {
|
|
|
$request['home_team'] = isset($req->home_team) ? trim($req->home_team) : null;
|
|
$request['home_team'] = isset($req->home_team) ? trim($req->home_team) : null;
|
|
|
$request['status'] = isset($req->status) ? trim($req->status) : '-1';
|
|
$request['status'] = isset($req->status) ? trim($req->status) : '-1';
|
|
@@ -29,7 +29,7 @@ class SportsbkController extends Controller {
|
|
|
$dt->addColsFields('csnum', array('templet' => '#csnum', 'sort' => false, 'width' => 70));
|
|
$dt->addColsFields('csnum', array('templet' => '#csnum', 'sort' => false, 'width' => 70));
|
|
|
$dt->addColsFields('sectionone_two', array('templet' => '#sectionone_two', 'sort' => false, 'width' => 200));
|
|
$dt->addColsFields('sectionone_two', array('templet' => '#sectionone_two', 'sort' => false, 'width' => 200));
|
|
|
$dt->addColsFields('sectionthere_four', array('templet' => '#sectionthere_four', 'sort' => false, 'width' => 200));
|
|
$dt->addColsFields('sectionthere_four', array('templet' => '#sectionthere_four', 'sort' => false, 'width' => 200));
|
|
|
- $dt->addColsFields('status', array('templet' => '#userdetail', 'sort' => false, 'width' => 100));
|
|
|
|
|
|
|
+ $dt->addColsFields('status', array('templet' => '#matchstatus', 'sort' => false, 'width' => 100));
|
|
|
if (checkRriv('/admin/Sportsbk/edit')) {
|
|
if (checkRriv('/admin/Sportsbk/edit')) {
|
|
|
$arr[] = 'edit';
|
|
$arr[] = 'edit';
|
|
|
}
|
|
}
|
|
@@ -41,7 +41,7 @@ class SportsbkController extends Controller {
|
|
|
|
|
|
|
|
function info() {
|
|
function info() {
|
|
|
$page = Request::has('page') ? Request::get('page') : '';
|
|
$page = Request::has('page') ? Request::get('page') : '';
|
|
|
- $list = Request::has('limit') ? Request::get('limit') : 10;
|
|
|
|
|
|
|
+ $list = Request::has('limit') ? Request::get('limit') : 1;
|
|
|
$home_team = Request::has('home_team') ? Request::get('home_team') : '';
|
|
$home_team = Request::has('home_team') ? Request::get('home_team') : '';
|
|
|
$sureblurs = Request::has('sureblurs') ? Request::get('sureblurs') : 'off';
|
|
$sureblurs = Request::has('sureblurs') ? Request::get('sureblurs') : 'off';
|
|
|
$status = Request::has('status') ? Request::get('status') : '';
|
|
$status = Request::has('status') ? Request::get('status') : '';
|
|
@@ -66,9 +66,77 @@ class SportsbkController extends Controller {
|
|
|
$newapp = new \App\Models\Stlqresult();
|
|
$newapp = new \App\Models\Stlqresult();
|
|
|
$data = $newapp->resultbklist($list, $page, $where, $orwhere);
|
|
$data = $newapp->resultbklist($list, $page, $where, $orwhere);
|
|
|
|
|
|
|
|
|
|
+ for ($i=0; $i < count($data['data']); $i++) {
|
|
|
|
|
+ $match_id = $data['data'][$i]['match_id'];
|
|
|
|
|
+ $score = $newapp->allscore($match_id,5);
|
|
|
|
|
+
|
|
|
|
|
+ if(!empty($score[0])){
|
|
|
|
|
+ $data['data'][$i]['okteamscore'] = $score[0]['guest_score']?$score[0]['guest_score']:0;//第一节客队比分
|
|
|
|
|
+ $data['data'][$i]['ozteamscore'] = $score[0]['home_score']?$score[0]['home_score']:0;//第一节主队比分
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $data['data'][$i]['okteamscore'] = 0;//第一节客队比分
|
|
|
|
|
+ $data['data'][$i]['ozteamscore'] = 0;//第一节主队比分
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!empty($score[1])){
|
|
|
|
|
+ $data['data'][$i]['tkteamscore'] = $score[1]['guest_score']?$score[1]['guest_score']:0;//第二节客队比分
|
|
|
|
|
+ $data['data'][$i]['tzteamscore'] = $score[1]['home_score']?$score[1]['home_score']:0;//第二节主队比分
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $data['data'][$i]['tkteamscore'] = 0;//第二节客队比分
|
|
|
|
|
+ $data['data'][$i]['tzteamscore'] = 0;//第二节主队比分
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!empty($score[2])){
|
|
|
|
|
+ $data['data'][$i]['skteamscore'] = $score[2]['guest_score']?$score[2]['guest_score']:0;//第三节客队比分
|
|
|
|
|
+ $data['data'][$i]['szteamscore'] = $score[2]['home_score']?$score[2]['home_score']:0;//第三节主队比分
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $data['data'][$i]['skteamscore'] = 0;//第三节客队比分
|
|
|
|
|
+ $data['data'][$i]['szteamscore'] = 0;//第三节主队比分
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!empty($score[3])){
|
|
|
|
|
+ $data['data'][$i]['akteamscore'] = $score[3]['guest_score']?$score[3]['guest_score']:0;//第四节客队比分
|
|
|
|
|
+ $data['data'][$i]['azteamscore'] = $score[3]['home_score']?$score[3]['home_score']:0;//第四节主队比分
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $data['data'][$i]['akteamscore'] = 0;//第四节客队比分
|
|
|
|
|
+ $data['data'][$i]['azteamscore'] = 0;//第四节主队比分
|
|
|
|
|
+ }
|
|
|
|
|
+ // unset($data['data'][$i]['match_process'],$data['data'][$i]['id'],$data['data'][$i]['home_score'],$data['data'][$i]['guest_score'],$data['data'][$i]['update_time']); //去重
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // $data['data'] = array_unique($data['data'], SORT_REGULAR); //去重
|
|
|
return \App\Lib\DataTable\DataTable::init()->toJson($data['data'], $data['total']);
|
|
return \App\Lib\DataTable\DataTable::init()->toJson($data['data'], $data['total']);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //修改添加赛事比分
|
|
|
|
|
+ function updatascore(Req $req){
|
|
|
|
|
+ $only = $req->only;//节数唯一标识
|
|
|
|
|
+ $num = $req->num;//比分
|
|
|
|
|
+ $match_id = $req->match_id;//节数唯一标识
|
|
|
|
|
+ $okteamscore = $req->okteamscore;//第一节客队比分
|
|
|
|
|
+ $ozteamscore = $req->ozteamscore;//第一节主队比分
|
|
|
|
|
+ $tkteamscore = $req->tkteamscore;//第二节客队比分
|
|
|
|
|
+ $tzteamscore = $req->tzteamscore;//第二节主队比分
|
|
|
|
|
+ $skteamscore = $req->skteamscore;//第三节客队比分
|
|
|
|
|
+ $szteamscore = $req->szteamscore;//第三节主队比分
|
|
|
|
|
+ $akteamscore = $req->akteamscore;//第四节客队比分
|
|
|
|
|
+ $azteamscore = $req->azteamscore;//第四节主队比分
|
|
|
|
|
+
|
|
|
|
|
+ $newapp = new \App\Models\Stlqresult();
|
|
|
|
|
+ $alldata = $newapp->onlyselect($match_id);
|
|
|
|
|
+
|
|
|
|
|
+ if($only==1 || $only==2){
|
|
|
|
|
+ $ret = \App\Models\Stlqresult::updateOrCreate(['match_id'=>$match_id,'match_process'=>1],array_merge($alldata,['home_score'=>intval($ozteamscore),'guest_score'=>intval($okteamscore),'update_time'=>date('Y-m-d H:i:s'),'match_process'=>1]));
|
|
|
|
|
+ }
|
|
|
|
|
+ if($only==3 || $only==4){
|
|
|
|
|
+ $ret = \App\Models\Stlqresult::updateOrCreate(['match_id'=>$match_id,'match_process'=>2],array_merge($alldata,['home_score'=>intval($tzteamscore),'guest_score'=>intval($tkteamscore),'update_time'=>date('Y-m-d H:i:s'),'match_process'=>2]));
|
|
|
|
|
+ }
|
|
|
|
|
+ if($only==5 || $only==6){
|
|
|
|
|
+ $ret = \App\Models\Stlqresult::updateOrCreate(['match_id'=>$match_id,'match_process'=>3],array_merge($alldata,['home_score'=>intval($szteamscore),'guest_score'=>intval($skteamscore),'update_time'=>date('Y-m-d H:i:s'),'match_process'=>3]));
|
|
|
|
|
+ }
|
|
|
|
|
+ if($only==7 || $only==8){
|
|
|
|
|
+ $ret = \App\Models\Stlqresult::updateOrCreate(['match_id'=>$match_id,'match_process'=>4],array_merge($alldata,['home_score'=>intval($azteamscore),'guest_score'=>intval($akteamscore),'update_time'=>date('Y-m-d H:i:s'),'match_process'=>4]));
|
|
|
|
|
+ }
|
|
|
|
|
+ return responseToJson(1);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function saislist(){
|
|
function saislist(){
|
|
|
$lgid = $_POST['lgid'];//赛事id
|
|
$lgid = $_POST['lgid'];//赛事id
|
|
|
$newstzqcompetition = new \App\Models\SportsBasket();
|
|
$newstzqcompetition = new \App\Models\SportsBasket();
|