浏览代码

Merge branch 'master' of http://git.bocai108.com:10180/aqm/sports_admin

# Conflicts:
#	app/Lib/Settlement/SettlementOrder.php
彭俊 6 年之前
父节点
当前提交
533d1ff1df
共有 35 个文件被更改,包括 563 次插入299 次删除
  1. 5 5
      app/Http/Controllers/Admin/BaseLeagueController.php
  2. 3 3
      app/Http/Controllers/Admin/BasketLeagueController.php
  3. 3 3
      app/Http/Controllers/Admin/SoccerLeagueController.php
  4. 1 1
      app/Http/Controllers/Admin/SoccerNoteListController.php
  5. 1 1
      app/Http/Controllers/Admin/SoccerStringNoteListController.php
  6. 19 19
      app/Http/Controllers/Admin/SportsBaseController.php
  7. 20 20
      app/Http/Controllers/Admin/SportsBasketController.php
  8. 20 19
      app/Http/Controllers/Admin/SportsSoccerController.php
  9. 19 19
      app/Http/Controllers/Admin/SportsTennisController.php
  10. 20 1
      app/Http/Controllers/Admin/SportsfootController.php
  11. 3 3
      app/Http/Controllers/Admin/TennisLeagueController.php
  12. 2 2
      app/Lib/Settlement/Adapter/RulePlus.php
  13. 8 5
      app/Lib/Settlement/Adapter/ZqRule.php
  14. 2 0
      app/Lib/Settlement/SettlementOrder.php
  15. 9 9
      app/Models/BaseLeague.php
  16. 9 9
      app/Models/BasketLeague.php
  17. 3 2
      app/Models/MoneyBuyMatch.php
  18. 5 3
      app/Models/MoneyBuyStr.php
  19. 9 9
      app/Models/SoccerLeague.php
  20. 31 31
      app/Models/SportsBase.php
  21. 31 31
      app/Models/SportsBasket.php
  22. 46 18
      app/Models/SportsNoteList.php
  23. 31 31
      app/Models/SportsSoccer.php
  24. 31 31
      app/Models/SportsTennis.php
  25. 9 9
      app/Models/TennisLeague.php
  26. 1 1
      resources/views/admin/sportsfoot/addoutcome.blade.php
  27. 210 2
      resources/views/admin/sportsfoot/outcome.blade.php
  28. 1 1
      resources/views/sports/base_form.blade.php
  29. 2 2
      resources/views/sports/base_odds.blade.php
  30. 1 1
      resources/views/sports/basket_form.blade.php
  31. 2 2
      resources/views/sports/basket_odds.blade.php
  32. 1 1
      resources/views/sports/soccer_form.blade.php
  33. 2 2
      resources/views/sports/soccer_odds.blade.php
  34. 1 1
      resources/views/sports/tennis_form.blade.php
  35. 2 2
      resources/views/sports/tennis_odds.blade.php

+ 5 - 5
app/Http/Controllers/Admin/BaseLeagueController.php

@@ -19,7 +19,7 @@ class BaseLeagueController extends Controller {
         $request['name_chinese'] = isset($req->name_chinese) ? trim($req->name_chinese) : '';
         $request['area_id'] = isset($req->area_id) ? trim($req->area_id) : '';
         $request['country_id'] = isset($req->country_id) ? trim($req->country_id) : '';
-        $request['id'] = isset($req->id) ? trim($req->id) : '';
+        $request['lg_id'] = isset($req->lg_id) ? trim($req->lg_id) : '';
         $request['status'] = isset($req->status) ? trim($req->status) : '0';
         $request['sureblurs'] = isset($req->sureblurs) ? $req->sureblurs : 'on';
         $data = \App\Models\BaseLeague::select('id','lg_id','name_chinese')->get();
@@ -31,7 +31,7 @@ class BaseLeagueController extends Controller {
         $dt = \App\Lib\DataTable\DataTable::init();
         $dt->setDataSource('/admin/BaseLeague/info');
         $dt->setLang('sportsbase');
-        $dt->addColsFields('id', array('templet' => '#userdetail', 'sort' => true, 'width' => 120));
+        $dt->addColsFields('lg_id', array('templet' => '#userdetail', 'sort' => true, 'width' => 120));
         $dt->addColsFields('name_chinese', array('templet' => '#userdetail', 'sort' => false, 'width' => 200));
         $dt->addColsFields('area', array('sort' => false, 'width' => 180));
         $dt->addColsFields('country', array('sort' => true, 'width' => 180));
@@ -145,7 +145,7 @@ class BaseLeagueController extends Controller {
             if (!$areas) {
                 return -2;
             }
-            $data = \App\Models\BaseLeague::where('id',$id)->first();
+            $data = \App\Models\BaseLeague::where('lg_id',$id)->first();
             $areaname = \App\Models\StAreaCountry::where('id',$data->area_id)->first();
             $countryname = \App\Models\StAreaCountry::where('id',$data->country_id)->first();
             if(!empty($areaname)){
@@ -161,7 +161,7 @@ class BaseLeagueController extends Controller {
             return view('sports.base_league_form', $data);
         } else {
             $model = new \App\Models\BaseLeague();
-            $model->id = $req->input('id');
+            $model->id = $id;
             $model = $model::find($model->id);
             if(!empty($req->input('country_id'))){
                 $model->country_id = $req->input('country_id');
@@ -173,7 +173,7 @@ class BaseLeagueController extends Controller {
             }else{
                 $model->area_id = 0;
             }
-            $model->status = $req->input('status');
+            //$model->status = $req->input('status');
             $model->utime = date('Y-m-d H:i:s',time());
             $model->save();
             return responseToJson(1);

+ 3 - 3
app/Http/Controllers/Admin/BasketLeagueController.php

@@ -19,7 +19,7 @@ class BasketLeagueController extends Controller {
         $request['name_chinese'] = isset($req->name_chinese) ? trim($req->name_chinese) : '';
         $request['area_id'] = isset($req->area_id) ? trim($req->area_id) : '';
         $request['country_id'] = isset($req->country_id) ? trim($req->country_id) : '';
-        $request['id'] = isset($req->id) ? trim($req->id) : '';
+        $request['lg_id'] = isset($req->lg_id) ? trim($req->lg_id) : '';
         $request['status'] = isset($req->status) ? trim($req->status) : '0';
         $request['sureblurs'] = isset($req->sureblurs) ? $req->sureblurs : 'on';
         $data = \App\Models\BasketLeague::select('id','lg_id','name_chinese')->get();
@@ -31,7 +31,7 @@ class BasketLeagueController extends Controller {
         $dt = \App\Lib\DataTable\DataTable::init();
         $dt->setDataSource('/admin/BasketLeague/info');
         $dt->setLang('sportsbase');
-        $dt->addColsFields('id', array('templet' => '#userdetail', 'sort' => true, 'width' => 120));
+        $dt->addColsFields('lg_id', array('templet' => '#userdetail', 'sort' => true, 'width' => 120));
         $dt->addColsFields('name_chinese', array('templet' => '#userdetail', 'sort' => false, 'width' => 200));
         $dt->addColsFields('area', array('sort' => false, 'width' => 180));
         $dt->addColsFields('country', array('sort' => true, 'width' => 180));
@@ -145,7 +145,7 @@ class BasketLeagueController extends Controller {
             if (!$areas) {
                 return -2;
             }
-            $data = \App\Models\BasketLeague::where('id',$id)->first();
+            $data = \App\Models\BasketLeague::where('lg_id',$id)->first();
             $areaname = \App\Models\StAreaCountry::where('id',$data->area_id)->first();
             $countryname = \App\Models\StAreaCountry::where('id',$data->country_id)->first();
             if(!empty($areaname)){

+ 3 - 3
app/Http/Controllers/Admin/SoccerLeagueController.php

@@ -19,7 +19,7 @@ class SoccerLeagueController extends Controller {
         $request['name_chinese'] = isset($req->name_chinese) ? trim($req->name_chinese) : '';
         $request['area_id'] = isset($req->area_id) ? trim($req->area_id) : '';
         $request['country_id'] = isset($req->country_id) ? trim($req->country_id) : '';
-        $request['id'] = isset($req->id) ? trim($req->id) : '';
+        $request['lg_id'] = isset($req->lg_id) ? trim($req->lg_id) : '';
         $request['status'] = isset($req->status) ? trim($req->status) : '0';
         $request['sureblurs'] = isset($req->sureblurs) ? $req->sureblurs : 'on';
         $data = \App\Models\SoccerLeague::select('id','lg_id','name_chinese')->get();
@@ -31,7 +31,7 @@ class SoccerLeagueController extends Controller {
         $dt = \App\Lib\DataTable\DataTable::init();
         $dt->setDataSource('/admin/SoccerLeague/info');
         $dt->setLang('sportsbase');
-        $dt->addColsFields('id', array('templet' => '#userdetail', 'sort' => true, 'width' => 120));
+        $dt->addColsFields('lg_id', array('templet' => '#userdetail', 'sort' => true, 'width' => 120));
         $dt->addColsFields('name_chinese', array('templet' => '#userdetail', 'sort' => false, 'width' => 200));
         $dt->addColsFields('area', array('sort' => false, 'width' => 180));
         $dt->addColsFields('country', array('sort' => true, 'width' => 180));
@@ -144,7 +144,7 @@ class SoccerLeagueController extends Controller {
             if (!$areas) {
                 return -2;
             }
-            $data = \App\Models\SoccerLeague::where('id',$id)->first();
+            $data = \App\Models\SoccerLeague::where('lg_id',$id)->first();
             $areaname = \App\Models\StAreaCountry::where('id',$data->area_id)->first();
             $countryname = \App\Models\StAreaCountry::where('id',$data->country_id)->first();
             if(!empty($areaname)){

+ 1 - 1
app/Http/Controllers/Admin/SoccerNoteListController.php

@@ -151,7 +151,7 @@ class SoccerNoteListController extends Controller
         $model->status = '1';
         try {
             DB::beginTransaction();//开启事务
-            \App\Models\SportsNoteList::where('id',$id)->update(['status'=>'2'],['gain_money'=>'0']);
+            \App\Models\SportsNoteList::where('id',$id)->update(['status'=>'2','gain_money'=>'0']);
             \App\Models\Account_detailed::where('account_identity',$order->account_identity)->update(['available_cash'=>$new_available_cash,'cash'=>$new_available_cash]);
             $model->save();
 

+ 1 - 1
app/Http/Controllers/Admin/SoccerStringNoteListController.php

@@ -174,7 +174,7 @@ class SoccerStringNoteListController extends Controller
         $model->status = '1';
         try {
             DB::beginTransaction();//开启事务
-            \App\Models\MoneyBuyStr::where('id',$id)->update(['status'=>'2'],['gain_money'=>'0']);
+            \App\Models\MoneyBuyStr::where('id',$id)->update(['status'=>'2','gain_money'=>'0.00']);
             \App\Models\Account_detailed::where('account_identity',$order->account_identity)->update(['available_cash'=>$new_available_cash,'cash'=>$new_available_cash]);
             $model->save();
             DB::commit();//提交

+ 19 - 19
app/Http/Controllers/Admin/SportsBaseController.php

@@ -22,14 +22,14 @@ class SportsBaseController extends Controller {
         $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\BaseLeague::join('st_bq_local_league','st_bq_league.id','=','st_bq_local_league.lg_id')->select('st_bq_league.id','st_bq_league.name_chinese')->where('st_bq_local_league.source',$source->infocontent)->get();
-        }else{
-            $data = \App\Models\BaseLeague::select('id','name_chinese')->get();
-        }
+//        $source = \App\Models\Setinfo::where('id','1000')->first();
+//        if($source->infocontent != '混合数据'){
+//            $data = \App\Models\BaseLeague::join('st_bq_local_league','st_bq_league.id','=','st_bq_local_league.lg_id')->select('st_bq_league.id','st_bq_league.name_chinese')->where('st_bq_local_league.source',$source->infocontent)->get();
+//        }else{
+//            $data = \App\Models\BaseLeague::select('id','name_chinese')->get();
+//        }
 
-//        $data = \App\Models\BaseLeague::select('id','lg_id','name_chinese')->get();
+        $data = \App\Models\BaseLeague::select('id','lg_id','name_chinese')->get();
         $request['league'] = $data;
         $dt = \App\Lib\DataTable\DataTable::init();
         $dt->setDataSource('/admin/SportsBase/info');
@@ -111,14 +111,14 @@ class SportsBaseController extends Controller {
      */
     function getParent() {
 
-        $source = \App\Models\Setinfo::where('id','1000')->first();
-        if($source->infocontent != '混合数据'){
-            $data = \App\Models\BaseLeague::join('st_bq_local_league','st_bq_league.id','=','st_bq_local_league.lg_id')->select('st_bq_league.id','st_bq_league.name_chinese')->where('st_bq_local_league.source',$source->infocontent)->get();
-        }else{
-            $data = \App\Models\BaseLeague::select('id','name_chinese')->get();
-        }
+//        $source = \App\Models\Setinfo::where('id','1000')->first();
+//        if($source->infocontent != '混合数据'){
+//            $data = \App\Models\BaseLeague::join('st_bq_local_league','st_bq_league.id','=','st_bq_local_league.lg_id')->select('st_bq_league.id','st_bq_league.name_chinese')->where('st_bq_local_league.source',$source->infocontent)->get();
+//        }else{
+//            $data = \App\Models\BaseLeague::select('id','name_chinese')->get();
+//        }
 
-//        $data = \App\Models\BaseLeague::select('id','lg_id','name_chinese')->get();
+        $data = \App\Models\BaseLeague::select('id','lg_id','name_chinese')->get();
         if (!$data) {
             return;
         }
@@ -212,7 +212,7 @@ class SportsBaseController extends Controller {
             if (!$data) {
                 return -2;
             }
-            $name_chinese = \App\Models\BaseLeague::where('id', $data->lg_id)->first();
+            $name_chinese = \App\Models\BaseLeague::where('lg_id', $data->lg_id)->first();
 //            $home_team = \App\Model\Team::where('team_name_cn', $data->home_team)->first();
 //            $guest_team = \App\Model\Team::where('team_name_cn', $data->guest_team)->first();
 //            $home_country = \App\Model\Country::where('country_id', $home_team->country_id)->first();
@@ -320,13 +320,13 @@ class SportsBaseController extends Controller {
         $cp_id = $req->id;
         $request['status'] = isset($req->status) ? trim($req->status) : '-1';
         $request['p_code'] = isset($req->p_code) ? trim($req->p_code) : '-1';
-        $request['id'] = isset($req->id) ? trim($req->id) : null;
-        $newapp = \App\Models\SportsBase::where('id',$request['id'])->first();
+        $request['match_id'] = isset($req->match_id) ? trim($req->match_id) : null;
+        $newapp = \App\Models\SportsBase::where('id',$cp_id)->first();
         // $match_id = $newapp->match_id;
         if(empty($newapp)){
-            $match_id = $req->input('id');
+            $match_id = $req->input('match_id');
         }else{
-            $match_id = $newapp->id;
+            $match_id = $newapp->match_id;
         }
         $request['match_id'] = isset($match_id) ? trim($match_id) : null;
 

+ 20 - 20
app/Http/Controllers/Admin/SportsBasketController.php

@@ -22,14 +22,14 @@ class SportsBasketController extends Controller {
 		$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\BasketLeague::join('st_lq_local_league','st_lq_league.id','=','st_lq_local_league.lg_id')->select('st_lq_league.id','st_lq_league.name_chinese')->where('st_lq_local_league.source',$source->infocontent)->get();
-        }else{
-            $data = \App\Models\BasketLeague::select('id','name_chinese')->get();
-        }
-
-//		$data = \App\Models\BasketLeague::select('id','lg_id','name_chinese')->get();
+//        $source = \App\Models\Setinfo::where('id','1000')->first();
+//        if($source->infocontent != '混合数据'){
+//            $data = \App\Models\BasketLeague::join('st_lq_local_league','st_lq_league.id','=','st_lq_local_league.lg_id')->select('st_lq_league.id','st_lq_league.name_chinese')->where('st_lq_local_league.source',$source->infocontent)->get();
+//        }else{
+//            $data = \App\Models\BasketLeague::select('id','name_chinese')->get();
+//        }
+
+		$data = \App\Models\BasketLeague::select('id','lg_id','name_chinese')->get();
 		$request['league'] = $data;
 		$dt = \App\Lib\DataTable\DataTable::init();
 		$dt->setDataSource('/admin/SportsBasket/info');
@@ -113,14 +113,14 @@ class SportsBasketController extends Controller {
 	 */
 	function getParent() {
 
-        $source = \App\Models\Setinfo::where('id','1000')->first();
-        if($source->infocontent != '混合数据'){
-            $data = \App\Models\BasketLeague::join('st_lq_local_league','st_lq_league.id','=','st_lq_local_league.lg_id')->select('st_lq_league.id','st_lq_league.name_chinese')->where('st_lq_local_league.source',$source->infocontent)->get();
-        }else{
-            $data = \App\Models\BasketLeague::select('id','name_chinese')->get();
-        }
+//        $source = \App\Models\Setinfo::where('id','1000')->first();
+//        if($source->infocontent != '混合数据'){
+//            $data = \App\Models\BasketLeague::join('st_lq_local_league','st_lq_league.id','=','st_lq_local_league.lg_id')->select('st_lq_league.id','st_lq_league.name_chinese')->where('st_lq_local_league.source',$source->infocontent)->get();
+//        }else{
+//            $data = \App\Models\BasketLeague::select('id','name_chinese')->get();
+//        }
 
-//		$data = \App\Models\BasketLeague::select('id','lg_id','name_chinese')->get();
+		$data = \App\Models\BasketLeague::select('id','lg_id','name_chinese')->get();
 		if (!$data) {
 			return;
 		}
@@ -214,7 +214,7 @@ class SportsBasketController extends Controller {
 			if (!$data) {
 				return -2;
 			}
-			$name_chinese = \App\Models\BasketLeague::where('id', $data->lg_id)->first();
+			$name_chinese = \App\Models\BasketLeague::where('lg_id', $data->lg_id)->first();
 //            $home_team = \App\Model\Team::where('team_name_cn', $data->home_team)->first();
 //            $guest_team = \App\Model\Team::where('team_name_cn', $data->guest_team)->first();
 //            $home_country = \App\Model\Country::where('country_id', $home_team->country_id)->first();
@@ -322,13 +322,13 @@ class SportsBasketController extends Controller {
 		$cp_id = $req->id;
 		$request['status'] = isset($req->status) ? trim($req->status) : '-1';
 		$request['p_code'] = isset($req->p_code) ? trim($req->p_code) : '-1';
-		$request['id'] = isset($req->id) ? trim($req->id) : null;
-		$newapp = \App\Models\SportsBasket::where('id',$request['id'])->first();
+		$request['match_id'] = isset($req->match_id) ? trim($req->match_id) : null;
+		$newapp = \App\Models\SportsBasket::where('id',$cp_id)->first();
 		// $match_id = $newapp->match_id;
 		if(empty($newapp)){
-			$match_id = $req->input('id');
+			$match_id = $req->input('match_id');
 		}else{
-			$match_id = $newapp->id;
+			$match_id = $newapp->match_id;
 		}
 		$request['match_id'] = isset($match_id) ? trim($match_id) : null;
 		//$data = \App\Model\Matchcode::where('p_id','0')->get();

+ 20 - 19
app/Http/Controllers/Admin/SportsSoccerController.php

@@ -22,14 +22,14 @@ class SportsSoccerController extends Controller {
         $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();
-        }
+//        $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();
+        $data = \App\Models\SoccerLeague::select('id','lg_id','name_chinese')->get();
 
         $request['league'] = $data;
         $dt = \App\Lib\DataTable\DataTable::init();
@@ -109,14 +109,14 @@ 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();
-        }
+//        $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();
+        $data = \App\Models\SoccerLeague::select('id','lg_id','name_chinese')->get();
 
         if (!$data) {
             return;
@@ -211,7 +211,8 @@ class SportsSoccerController extends Controller {
             if (!$data) {
                 return -2;
             }
-            $name_chinese = \App\Models\SoccerLeague::where('id', $data->lg_id)->first();
+            //$name_chinese = \App\Models\SoccerLeague::where('id', $data->lg_id)->first();
+            $name_chinese = \App\Models\SoccerLeague::where('lg_id', $data->lg_id)->first();
 //            $home_team = \App\Model\Team::where('team_name_cn', $data->home_team)->first();
 //            $guest_team = \App\Model\Team::where('team_name_cn', $data->guest_team)->first();
 //            $home_country = \App\Model\Country::where('country_id', $home_team->country_id)->first();
@@ -319,13 +320,13 @@ class SportsSoccerController extends Controller {
         $cp_id = $req->id;
         $request['status'] = isset($req->status) ? trim($req->status) : '-1';
         $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();
+        $request['match_id'] = isset($req->match_id) ? trim($req->match_id) : null;
+        $newapp = \App\Models\SportsSoccer::where('id',$cp_id)->first();
        // $match_id = $newapp->match_id;
         if(empty($newapp)){
-            $match_id = $req->input('id');
+            $match_id = $req->input('match_id');
         }else{
-            $match_id = $newapp->id;
+            $match_id = $newapp->match_id;
         }
         $request['match_id'] = isset($match_id) ? trim($match_id) : null;
         $data = \App\Models\Matchcode::where('p_id','0')->where('game_code','zq')->get();

+ 19 - 19
app/Http/Controllers/Admin/SportsTennisController.php

@@ -22,14 +22,14 @@ class SportsTennisController extends Controller {
         $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\TennisLeague::join('st_wq_local_league','st_wq_league.id','=','st_wq_local_league.lg_id')->select('st_wq_league.id','st_wq_league.name_chinese')->where('st_wq_local_league.source',$source->infocontent)->get();
-        }else{
-            $data = \App\Models\TennisLeague::select('id','name_chinese')->get();
-        }
+//        $source = \App\Models\Setinfo::where('id','1000')->first();
+//        if($source->infocontent != '混合数据'){
+//            $data = \App\Models\TennisLeague::join('st_wq_local_league','st_wq_league.id','=','st_wq_local_league.lg_id')->select('st_wq_league.id','st_wq_league.name_chinese')->where('st_wq_local_league.source',$source->infocontent)->get();
+//        }else{
+//            $data = \App\Models\TennisLeague::select('id','name_chinese')->get();
+//        }
 
-//        $data = \App\Models\TennisLeague::select('id','lg_id','name_chinese')->get();
+        $data = \App\Models\TennisLeague::select('id','lg_id','name_chinese')->get();
         $request['league'] = $data;
         $dt = \App\Lib\DataTable\DataTable::init();
         $dt->setDataSource('/admin/SportsTennis/info');
@@ -112,14 +112,14 @@ class SportsTennisController extends Controller {
      */
     function getParent() {
 
-        $source = \App\Models\Setinfo::where('id','1000')->first();
-        if($source->infocontent != '混合数据'){
-            $data = \App\Models\TennisLeague::join('st_wq_local_league','st_wq_league.id','=','st_wq_local_league.lg_id')->select('st_wq_league.id','st_wq_league.name_chinese')->where('st_wq_local_league.source',$source->infocontent)->get();
-        }else{
-            $data = \App\Models\TennisLeague::select('id','name_chinese')->get();
-        }
+//        $source = \App\Models\Setinfo::where('id','1000')->first();
+//        if($source->infocontent != '混合数据'){
+//            $data = \App\Models\TennisLeague::join('st_wq_local_league','st_wq_league.id','=','st_wq_local_league.lg_id')->select('st_wq_league.id','st_wq_league.name_chinese')->where('st_wq_local_league.source',$source->infocontent)->get();
+//        }else{
+//            $data = \App\Models\TennisLeague::select('id','name_chinese')->get();
+//        }
 
-//        $data = \App\Models\TennisLeague::select('id','lg_id','name_chinese')->get();
+        $data = \App\Models\TennisLeague::select('id','lg_id','name_chinese')->get();
         if (!$data) {
             return;
         }
@@ -213,7 +213,7 @@ class SportsTennisController extends Controller {
             if (!$data) {
                 return -2;
             }
-            $name_chinese = \App\Models\TennisLeague::where('id', $data->lg_id)->first();
+            $name_chinese = \App\Models\TennisLeague::where('lg_id', $data->lg_id)->first();
 //            $home_team = \App\Model\Team::where('team_name_cn', $data->home_team)->first();
 //            $guest_team = \App\Model\Team::where('team_name_cn', $data->guest_team)->first();
 //            $home_country = \App\Model\Country::where('country_id', $home_team->country_id)->first();
@@ -321,13 +321,13 @@ class SportsTennisController extends Controller {
         $cp_id = $req->id;
         $request['status'] = isset($req->status) ? trim($req->status) : '-1';
         $request['p_code'] = isset($req->p_code) ? trim($req->p_code) : '-1';
-        $request['id'] = isset($req->id) ? trim($req->id) : null;
-        $newapp = \App\Models\SportsTennis::where('id',$request['id'])->first();
+        $request['match_id'] = isset($req->match_id) ? trim($req->match_id) : null;
+        $newapp = \App\Models\SportsTennis::where('id',$cp_id)->first();
         // $match_id = $newapp->match_id;
         if(empty($newapp)){
-            $match_id = $req->input('id');
+            $match_id = $req->input('match_id');
         }else{
-            $match_id = $newapp->id;
+            $match_id = $newapp->match_id;
         }
         $request['match_id'] = isset($match_id) ? trim($match_id) : null;
         //$data = \App\Model\Matchcode::where('p_id','0')->get();

+ 20 - 1
app/Http/Controllers/Admin/SportsfootController.php

@@ -50,7 +50,26 @@ class SportsfootController extends Controller {
 		return view('admin.sportsfoot/outcome', $dt->render($request));
 	}
 
+	//结果添加
+	function addend(Req $req){
+		$match_id = $req->input('match_id');
+		$model = \App\Models\Stzqresult::where('match_id', $match_id)->first();
+		$model->first_score = $req->firstscore;
+		$model->last_score = $req->lastscore;
+		$model->match_winer = $req->matchwiner;
+		$model->u_home_score = $req->uhomescore;
+		$model->u_guest_score = $req->uguestscore;           
+	   
+        $model->save();
+        return responseToJson(1);
+	}
 
+	//查询赛事结果
+	function Matchresult(Req $req){
+		$match_id = $req->match_id;
+		$newapp = \App\Models\Stzqresult::where('match_id', $match_id)->first();
+		return $newapp;
+	}
 
 	//结算
 	function Settlement(Req $req){
@@ -61,7 +80,7 @@ class SportsfootController extends Controller {
 		$simplex_ids = array_column($newapp->allsimplexorder($ssid,'zq'),'order_id');
 		$str_ids = array_column($newapp->allstrorder($ssid),'order_id');
 
-		$update = $this->addcomendnotice($ssid);
+		$update = $this->addcomendnotice($ssid); 
 		if($update['status']==1){
 			$SettlementOrder = new SettlementOrder();
 	        $SettlementOrder->reSettlement($str_ids, 2,$type,'zq',$ssid);//串式

+ 3 - 3
app/Http/Controllers/Admin/TennisLeagueController.php

@@ -19,7 +19,7 @@ class TennisLeagueController extends Controller {
         $request['name_chinese'] = isset($req->name_chinese) ? trim($req->name_chinese) : '';
         $request['area_id'] = isset($req->area_id) ? trim($req->area_id) : '';
         $request['country_id'] = isset($req->country_id) ? trim($req->country_id) : '';
-        $request['id'] = isset($req->id) ? trim($req->id) : '';
+        $request['lg_id'] = isset($req->lg_id) ? trim($req->lg_id) : '';
         $request['status'] = isset($req->status) ? trim($req->status) : '0';
         $request['sureblurs'] = isset($req->sureblurs) ? $req->sureblurs : 'on';
         $data = \App\Models\SoccerLeague::select('id','lg_id','name_chinese')->get();
@@ -31,7 +31,7 @@ class TennisLeagueController extends Controller {
         $dt = \App\Lib\DataTable\DataTable::init();
         $dt->setDataSource('/admin/TennisLeague/info');
         $dt->setLang('sportsbase');
-        $dt->addColsFields('id', array('templet' => '#userdetail', 'sort' => true, 'width' => 120));
+        $dt->addColsFields('lg_id', array('templet' => '#userdetail', 'sort' => true, 'width' => 120));
         $dt->addColsFields('name_chinese', array('templet' => '#userdetail', 'sort' => false, 'width' => 200));
         $dt->addColsFields('area', array('sort' => false, 'width' => 180));
         $dt->addColsFields('country', array('sort' => true, 'width' => 180));
@@ -146,7 +146,7 @@ class TennisLeagueController extends Controller {
             if (!$areas) {
                 return -2;
             }
-            $data = \App\Models\TennisLeague::where('id',$id)->first();
+            $data = \App\Models\TennisLeague::where('lg_id',$id)->first();
             $areaname = \App\Models\StAreaCountry::where('id',$data->area_id)->first();
             $countryname = \App\Models\StAreaCountry::where('id',$data->country_id)->first();
             if(!empty($areaname)){

+ 2 - 2
app/Lib/Settlement/Adapter/RulePlus.php

@@ -287,8 +287,8 @@ trait RulePlus
         ];
 
         foreach ($arr as $key => $val) {
-            $tmp_home = intval($val->home);
-            $tmp_guest = intval($val->guest);
+            $tmp_home = intval($val->home_score);
+            $tmp_guest = intval($val->guest_score);
             $tmp_home_rate = intval($val->home_rate);
             $tmp_guest_rate = intval($val->guest_rate);
 

+ 8 - 5
app/Lib/Settlement/Adapter/ZqRule.php

@@ -187,8 +187,9 @@ class ZqRule
     public function goal_size_big($model, $resultModels, $resultRecords)
     {
         $resultModel = $resultModels['0'];
-        $word = $resultModel->all_goal . "(全场)";
-        $returnDatas = $this->zq_inball_bigsmall($resultModel->all_goal, $model->condition, 2, $word);
+        $allscore = intval($resultModel->home_score) + intval($resultModel->guest_score);
+        $word = $allscore . "(全场)";
+        $returnDatas = $this->zq_inball_bigsmall($allscore, $model->condition, 2, $word);
         return $returnDatas;
 
     }
@@ -197,8 +198,9 @@ class ZqRule
     public function goal_size_small($model, $resultModels, $resultRecords)
     {
         $resultModel = $resultModels['0'];
-        $word = $resultModel->all_goal . "(全场)";
-        $returnDatas = $this->zq_inball_bigsmall($resultModel->all_goal, $model->condition, 1, $word);
+        $allscore = intval($resultModel->home_score) + intval($resultModel->guest_score);
+        $word = $allscore . "(全场)";
+        $returnDatas = $this->zq_inball_bigsmall($allscore, $model->condition, 1, $word);
         return $returnDatas;
     }
 
@@ -398,7 +400,8 @@ class ZqRule
     {
         $pos = count($resultModel) - 1;
         $resultModel = $resultModel[$pos];
-        if ($resultModel->all_goal <= 0) {
+        $all_score = intval($resultModel->home_score) + intval($resultModel->guest_score);
+        if ($all_score <= 0) {
             return ['result' => 1, 'matchResult' => ''];
         } else {
             return ['result' => -1, 'matchResult' => ''];

+ 2 - 0
app/Lib/Settlement/SettlementOrder.php

@@ -45,6 +45,8 @@ class SettlementOrder extends SettlementBase
     ///$order_ids 某场比塞全部订单数组, $bettype=2 订单类型: 1单式  2串式(默认),    $settype = 1 结算次数:1首次(默认)  2非首次或重结算
     public function reSettlement($order_ids, $bettype = 2, $settype = 1, $game_code = 0, $match_id = 0)
     {
+        $order_ids = array_unique($order_ids);
+
         if (intval($match_id) <= 0) {
             return self::makeData(8, 'matchid不能为空或0!');
         }

+ 9 - 9
app/Models/BaseLeague.php

@@ -12,21 +12,21 @@ class BaseLeague extends BaseModel {
 
     function getinfo($list = 10, $page, $where = '')
     {
-        $source = \App\Models\Setinfo::where('id','1000')->first();
-        if($source->infocontent != '混合数据'){
-            $where[] = array('st_bq_local_league.source', '=', $source->infocontent);
-        }
+//        $source = \App\Models\Setinfo::where('id','1000')->first();
+//        if($source->infocontent != '混合数据'){
+//            $where[] = array('st_bq_local_league.source', '=', $source->infocontent);
+//        }
         if (is_array ($where) && count ($where) > 0){
             $data = $this
-                ->join('st_bq_local_league','st_bq_league.id','=','st_bq_local_league.lg_id')
-                ->select('st_bq_league.id','st_bq_league.name_chinese','st_bq_league.area_id','st_bq_league.country_id','st_bq_league.status','st_bq_league.utime')
+                //->join('st_bq_local_league','st_bq_league.id','=','st_bq_local_league.lg_id')
+                ->select('st_bq_league.lg_id','st_bq_league.name_chinese','st_bq_league.area_id','st_bq_league.country_id','st_bq_league.utime')
                 ->orderby('st_bq_league.utime','desc')
                 ->where($where)
                 ->paginate ($list);
         }else{
             $data = $this
-                ->join('st_bq_local_league','st_bq_league.id','=','st_bq_local_league.lg_id')
-                ->select('st_bq_league.id','st_bq_league.name_chinese','st_bq_league.area_id','st_bq_league.country_id','st_bq_league.status','st_bq_league.utime')
+                //->join('st_bq_local_league','st_bq_league.id','=','st_bq_local_league.lg_id')
+                ->select('st_bq_league.lg_id','st_bq_league.name_chinese','st_bq_league.area_id','st_bq_league.country_id','st_bq_league.utime')
                 ->orderby('st_bq_league.utime','desc')
                 ->paginate ($list);
         }
@@ -43,7 +43,7 @@ class BaseLeague extends BaseModel {
         $country = \App\Models\StAreaCountry::where('pid','<>','0')->get();
 
         for($i=0;$i<count($data);$i++){
-            //$data[$i]->id = $data[$i]->lg_id;
+            $data[$i]->id = $data[$i]->lg_id;
 
             if($data[$i]->status == '-1'){
                 $data[$i]->league_status = '未启用';

+ 9 - 9
app/Models/BasketLeague.php

@@ -14,21 +14,21 @@ class BasketLeague extends BaseModel {
 
     function getinfo($list = 10, $page, $where = '')
     {
-        $source = \App\Models\Setinfo::where('id','1000')->first();
-        if($source->infocontent != '混合数据'){
-            $where[] = array('st_lq_local_league.source', '=', $source->infocontent);
-        }
+//        $source = \App\Models\Setinfo::where('id','1000')->first();
+//        if($source->infocontent != '混合数据'){
+//            $where[] = array('st_lq_local_league.source', '=', $source->infocontent);
+//        }
         if (is_array ($where) && count ($where) > 0){
             $data = $this
-                ->join('st_lq_local_league','st_lq_league.id','=','st_lq_local_league.lg_id')
-                ->select('st_lq_league.id','st_lq_league.name_chinese','st_lq_league.area_id','st_lq_league.country_id','st_lq_league.status','st_lq_league.utime')
+                //->join('st_lq_local_league','st_lq_league.id','=','st_lq_local_league.lg_id')
+                ->select('st_lq_league.lg_id','st_lq_league.name_chinese','st_lq_league.area_id','st_lq_league.country_id','st_lq_league.utime')
                 ->orderby('st_lq_league.utime','desc')
                 ->where($where)
                 ->paginate ($list);
         }else{
             $data = $this
-                ->join('st_lq_local_league','st_lq_league.id','=','st_lq_local_league.lg_id')
-                ->select('st_lq_league.id','st_lq_league.name_chinese','st_lq_league.area_id','st_lq_league.country_id','st_lq_league.status','st_lq_league.utime')
+                //->join('st_lq_local_league','st_lq_league.id','=','st_lq_local_league.lg_id')
+                ->select('st_lq_league.lg_id','st_lq_league.name_chinese','st_lq_league.area_id','st_lq_league.country_id','st_lq_league.utime')
                 ->orderby('st_lq_league.utime','desc')
                 ->paginate ($list);
         }
@@ -45,7 +45,7 @@ class BasketLeague extends BaseModel {
         $country = \App\Models\StAreaCountry::where('pid','<>','0')->get();
 
         for($i=0;$i<count($data);$i++){
-            //$data[$i]->id = $data[$i]->lg_id;
+            $data[$i]->id = $data[$i]->lg_id;
 
             if($data[$i]->status == '-1'){
                 $data[$i]->league_status = '未启用';

+ 3 - 2
app/Models/MoneyBuyMatch.php

@@ -26,12 +26,13 @@ class MoneyBuyMatch extends Model
     }
 
   	//赛事下所有下注单式下单
-    function allsimplexorder($ssid){ 
+    function allsimplexorder($ssid,$code){ 
         //单式下单
         $where = array();
         $where[] = array('money_buy_match.match_id', '=', $ssid);
         $where[] = array('money_buy_match.bet_type', '=', 1);
-        $data = $this->join('money_buy_simplex','money_buy_match.batch_id','=','money_buy_simplex.batch_id')->select('money_buy_simplex.order_id','money_buy_simplex.money','money_buy_simplex.account_identity','money_buy_simplex.info_identity','money_buy_simplex.match_id')->where($where)->get()->toArray();
+		$where[] = array('money_buy_match.game_code', '=', $code);
+        $data = $this->join('money_buy_simplex','money_buy_match.match_id','=','money_buy_simplex.match_id')->select('money_buy_simplex.order_id','money_buy_simplex.money','money_buy_simplex.account_identity','money_buy_simplex.info_identity','money_buy_simplex.match_id')->where($where)->get()->toArray();
         return $data;
     }
 

+ 5 - 3
app/Models/MoneyBuyStr.php

@@ -41,8 +41,10 @@ class MoneyBuyStr extends BaseModel {
         $content = \App\Models\MoneyBuyMatch::where('bet_type','2')->get();
 
         for($i=0;$i<count($data);$i++){
-            if($data[$i]->status==1){
+            if($data[$i]->status==1 && $data[$i]->settle_status==1){
                 $data[$i]->order_status = '投注'.'<br><a class="layui-btn layui-btn-sm invalid" lay-event="detail" pid="id" uri="/admin/SoccerStringNoteList/invalid/?id=" href="javascript:invalid(\'/admin/SoccerStringNoteList/invalid/?id='.$data[$i]->id.'\');"> 作废 </a>';
+            }else if($data[$i]->status==1 && $data[$i]->settle_status==2){
+                $data[$i]->order_status = '投注';
             }else if($data[$i]->status==2){
                 $data[$i]->order_status = '作废'.'<br><a class="layui-btn layui-btn-sm audit" lay-event="detail" pid="id" uri="" href="javascript:void(0)" style="background-color: grey;"> 已作废 </a>';
             }else if($data[$i]->status==3){
@@ -80,7 +82,7 @@ class MoneyBuyStr extends BaseModel {
                 }
             }
             if($data[$i]->water_return == -1){
-                $data[$i]->water_return == 0;
+                $data[$i]->water_return = 0;
                 //用户投注后账户金额
                 $data[$i]->frozen_cash = $data[$i]->money_cash;
             }
@@ -154,7 +156,7 @@ class MoneyBuyStr extends BaseModel {
                 $data[$i]->condition = '';
             }
             
-            $league = DB::table('st_'.$data[$i]->game_code.'_league')->join('st_'.$data[$i]->game_code.'_competition','st_'.$data[$i]->game_code.'_competition.lg_id','=','st_'.$data[$i]->game_code.'_league.id')->where('st_'.$data[$i]->game_code.'_league.id',$data[$i]->lg_id)->where('st_'.$data[$i]->game_code.'_competition.id',$data[$i]->match_id)->first();
+            $league = DB::table('st_'.$data[$i]->game_code.'_league')->join('st_'.$data[$i]->game_code.'_competition','st_'.$data[$i]->game_code.'_competition.lg_id','=','st_'.$data[$i]->game_code.'_league.lg_id')->where('st_'.$data[$i]->game_code.'_league.lg_id',$data[$i]->lg_id)->where('st_'.$data[$i]->game_code.'_competition.match_id',$data[$i]->match_id)->first();
             if(!empty($league)){
                 //联赛名称
                 $data[$i]->league = $league->name_chinese;

+ 9 - 9
app/Models/SoccerLeague.php

@@ -14,20 +14,20 @@ class SoccerLeague extends BaseModel {
 
     function getinfo($list = 10, $page, $where = '')
     {
-        $source = \App\Models\Setinfo::where('id','1000')->first();
-        if($source->infocontent != '混合数据'){
-            $where[] = array('st_zq_local_league.source', '=', $source->infocontent);
-        }
+//        $source = \App\Models\Setinfo::where('id','1000')->first();
+//        if($source->infocontent != '混合数据'){
+//            $where[] = array('st_zq_local_league.source', '=', $source->infocontent);
+//        }
         if (is_array ($where) && count ($where) > 0){
             $data = $this
-                ->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','st_zq_league.area_id','st_zq_league.country_id','st_zq_league.status','st_zq_league.utime')
+                //->join('st_zq_local_league','st_zq_league.lg_id','=','st_zq_local_league.lg_id')
+                ->select('st_zq_league.lg_id','st_zq_league.name_chinese','st_zq_league.area_id','st_zq_league.country_id','st_zq_league.utime')
                 ->orderby('st_zq_league.utime','desc')
                 ->where($where)
                 ->paginate ($list);
         }else{
             $data = $this
-                ->select('st_zq_league.id','st_zq_league.name_chinese','st_zq_league.area_id','st_zq_league.country_id','st_zq_league.status','st_zq_league.utime')
+                ->select('st_zq_league.lg_id','st_zq_league.name_chinese','st_zq_league.area_id','st_zq_league.country_id','st_zq_league.utime')
                 ->orderby('st_zq_league.utime','desc')
                 ->paginate ($list);
         }
@@ -44,7 +44,7 @@ class SoccerLeague extends BaseModel {
         $country = \App\Models\StAreaCountry::where('pid','<>','0')->get();
 
         for($i=0;$i<count($data);$i++){
-            //$data[$i]->id = $data[$i]->lg_id;
+            $data[$i]->id = $data[$i]->lg_id;
 
             if($data[$i]->status == '-1'){
                 $data[$i]->league_status = '未启用';
@@ -87,7 +87,7 @@ class SoccerLeague extends BaseModel {
     //所有赛事id
     function allleague()
     {
-        $data = $this->select('id','name_chinese')->get();
+        $data = $this->select('lg_id','name_chinese')->get();
         if (!$data) {
 			return -5040000102; //无相关信息
 		}

+ 31 - 31
app/Models/SportsBase.php

@@ -49,49 +49,49 @@ class SportsBase extends BaseModel {
         
         $where[] = array('st_bq_league.name_chinese','<>','');
 
-        $source = \App\Models\Setinfo::where('id','1000')->first();
-        if($source->infocontent != '混合数据'){
-            $where[] = array('st_bq_local_match.source', '=', $source->infocontent);
-            $where[] = array('st_bq_local_league.source', '=', $source->infocontent);
-        }
+//        $source = \App\Models\Setinfo::where('id','1000')->first();
+//        if($source->infocontent != '混合数据'){
+//            $where[] = array('st_bq_local_match.source', '=', $source->infocontent);
+//            $where[] = array('st_bq_local_league.source', '=', $source->infocontent);
+//        }
+//
+//        if (is_array ($where) && count ($where) > 0) {
+//            $data = $this->join('st_bq_league','st_bq_competition.lg_id','=','st_bq_league.id')
+//                ->join('st_bq_local_match','st_bq_competition.id','=','st_bq_local_match.match_id')
+//                ->join('st_bq_local_league','st_bq_league.id','=','st_bq_local_league.lg_id')
+//                ->select('st_bq_competition.id','st_bq_local_match.match_id','st_bq_local_league.lg_id','st_bq_league.name_chinese','st_bq_league.last_time','st_bq_competition.home_team','st_bq_competition.guest_team','st_bq_competition.match_date','st_bq_competition.match_time','st_bq_competition.status','st_bq_competition.recommend')
+//                ->orderby('st_bq_competition.match_date','desc')
+//                ->orderby('st_bq_competition.match_time','desc')
+//                ->where($where)
+//                ->orwhere($orwhere)
+//                ->paginate ($list);
+//        } else {
+//            $data = $this->join('st_bq_league','st_bq_competition.lg_id','=','st_bq_league.id')
+//                ->join('st_bq_local_match','st_bq_competition.id','=','st_bq_local_match.match_id')
+//                ->join('st_bq_local_league','st_bq_league.id','=','st_bq_local_league.lg_id')
+//                ->select('st_bq_competition.id','st_bq_local_match.match_id','st_bq_local_league.lg_id','st_bq_league.name_chinese','st_bq_league.last_time','st_bq_competition.home_team','st_bq_competition.guest_team','st_bq_competition.match_date','st_bq_competition.match_time','st_bq_competition.status','st_bq_competition.recommend')
+//                ->orderby('st_bq_competition.match_date','desc')
+//                ->orderby('st_bq_competition.match_time','desc')
+//                ->paginate ($list);
+//        }
+
+
 
         if (is_array ($where) && count ($where) > 0) {
-            $data = $this->join('st_bq_league','st_bq_competition.lg_id','=','st_bq_league.id')
-                ->join('st_bq_local_match','st_bq_competition.id','=','st_bq_local_match.match_id')
-                ->join('st_bq_local_league','st_bq_league.id','=','st_bq_local_league.lg_id')
-                ->select('st_bq_competition.id','st_bq_local_match.match_id','st_bq_local_league.lg_id','st_bq_league.name_chinese','st_bq_league.last_time','st_bq_competition.home_team','st_bq_competition.guest_team','st_bq_competition.match_date','st_bq_competition.match_time','st_bq_competition.status','st_bq_competition.recommend')
+            $data = $this->join('st_bq_league','st_bq_competition.lg_id','=','st_bq_league.lg_id')
+                ->select('st_bq_competition.id','st_bq_competition.match_id','st_bq_competition.lg_id','st_bq_league.name_chinese','st_bq_league.last_time','st_bq_competition.home_team','st_bq_competition.guest_team','st_bq_competition.match_date','st_bq_competition.match_time','st_bq_competition.status','st_bq_competition.recommend')
                 ->orderby('st_bq_competition.match_date','desc')
                 ->orderby('st_bq_competition.match_time','desc')
                 ->where($where)
                 ->orwhere($orwhere)
                 ->paginate ($list);
         } else {
-            $data = $this->join('st_bq_league','st_bq_competition.lg_id','=','st_bq_league.id')
-                ->join('st_bq_local_match','st_bq_competition.id','=','st_bq_local_match.match_id')
-                ->join('st_bq_local_league','st_bq_league.id','=','st_bq_local_league.lg_id')
-                ->select('st_bq_competition.id','st_bq_local_match.match_id','st_bq_local_league.lg_id','st_bq_league.name_chinese','st_bq_league.last_time','st_bq_competition.home_team','st_bq_competition.guest_team','st_bq_competition.match_date','st_bq_competition.match_time','st_bq_competition.status','st_bq_competition.recommend')
+            $data = $this->join('st_bq_league','st_bq_competition.lg_id','=','st_bq_league.lg_id')
+                ->select('st_bq_competition.id','st_bq_competition.match_id','st_bq_competition.lg_id','st_bq_league.name_chinese','st_bq_league.last_time','st_bq_competition.home_team','st_bq_competition.guest_team','st_bq_competition.match_date','st_bq_competition.match_time','st_bq_competition.status','st_bq_competition.recommend')
                 ->orderby('st_bq_competition.match_date','desc')
                 ->orderby('st_bq_competition.match_time','desc')
                 ->paginate ($list);
         }
-
-
-
-//        if (is_array ($where) && count ($where) > 0) {
-//            $data = $this->join('st_bq_league','st_bq_competition.lg_id','=','st_bq_league.lg_id')
-//                ->select('st_bq_competition.id','st_bq_competition.match_id','st_bq_competition.lg_id','st_bq_league.name_chinese','st_bq_league.last_time','st_bq_competition.home_team','st_bq_competition.guest_team','st_bq_competition.match_date','st_bq_competition.match_time','st_bq_competition.status','st_bq_competition.recommend')
-//                ->orderby('st_bq_competition.match_date','desc')
-//                ->orderby('st_bq_competition.match_time','desc')
-//                ->where($where)
-//                ->orwhere($orwhere)
-//                ->paginate ($list);
-//        } else {
-//            $data = $this->join('st_bq_league','st_bq_competition.lg_id','=','st_bq_league.lg_id')
-//                ->select('st_bq_competition.id','st_bq_competition.match_id','st_bq_competition.lg_id','st_bq_league.name_chinese','st_bq_league.last_time','st_bq_competition.home_team','st_bq_competition.guest_team','st_bq_competition.match_date','st_bq_competition.match_time','st_bq_competition.status','st_bq_competition.recommend')
-//                ->orderby('st_bq_competition.match_date','desc')
-//                ->orderby('st_bq_competition.match_time','desc')
-//                ->paginate ($list);
-//        }
         if (!$data < 0) {
             return -2021052003; //
         }

+ 31 - 31
app/Models/SportsBasket.php

@@ -49,49 +49,49 @@ class SportsBasket extends BaseModel {
 
         $where[] = array('st_lq_league.name_chinese','<>','');
 
-        $source = \App\Models\Setinfo::where('id','1000')->first();
-        if($source->infocontent != '混合数据'){
-            $where[] = array('st_lq_local_match.source', '=', $source->infocontent);
-            $where[] = array('st_lq_local_league.source', '=', $source->infocontent);
-        }
+//        $source = \App\Models\Setinfo::where('id','1000')->first();
+//        if($source->infocontent != '混合数据'){
+//            $where[] = array('st_lq_local_match.source', '=', $source->infocontent);
+//            $where[] = array('st_lq_local_league.source', '=', $source->infocontent);
+//        }
+//
+//        if (is_array ($where) && count ($where) > 0) {
+//            $data = $this->join('st_lq_league','st_lq_competition.lg_id','=','st_lq_league.id')
+//                ->join('st_lq_local_match','st_lq_competition.id','=','st_lq_local_match.match_id')
+//                ->join('st_lq_local_league','st_lq_league.id','=','st_lq_local_league.lg_id')
+//                ->select('st_lq_competition.id','st_lq_local_match.match_id','st_lq_local_league.lg_id','st_lq_league.name_chinese','st_lq_league.last_time','st_lq_competition.home_team','st_lq_competition.guest_team','st_lq_competition.match_date','st_lq_competition.match_time','st_lq_competition.status','st_lq_competition.recommend')
+//                ->orderby('st_lq_competition.match_date','desc')
+//                ->orderby('st_lq_competition.match_time','desc')
+//                ->where($where)
+//                ->orwhere($orwhere)
+//                ->paginate ($list);
+//        } else {
+//            $data = $this->join('st_lq_league','st_lq_competition.lg_id','=','st_lq_league.id')
+//                ->join('st_lq_local_match','st_lq_competition.id','=','st_lq_local_match.match_id')
+//                ->join('st_lq_local_league','st_lq_league.id','=','st_lq_local_league.lg_id')
+//                ->select('st_lq_competition.id','st_lq_local_match.match_id','st_lq_local_league.lg_id','st_lq_league.name_chinese','st_lq_league.last_time','st_lq_competition.home_team','st_lq_competition.guest_team','st_lq_competition.match_date','st_lq_competition.match_time','st_lq_competition.status','st_lq_competition.recommend')
+//                ->orderby('st_lq_competition.match_date','desc')
+//                ->orderby('st_lq_competition.match_time','desc')
+//                ->paginate ($list);
+//        }
+
+
 
         if (is_array ($where) && count ($where) > 0) {
-            $data = $this->join('st_lq_league','st_lq_competition.lg_id','=','st_lq_league.id')
-                ->join('st_lq_local_match','st_lq_competition.id','=','st_lq_local_match.match_id')
-                ->join('st_lq_local_league','st_lq_league.id','=','st_lq_local_league.lg_id')
-                ->select('st_lq_competition.id','st_lq_local_match.match_id','st_lq_local_league.lg_id','st_lq_league.name_chinese','st_lq_league.last_time','st_lq_competition.home_team','st_lq_competition.guest_team','st_lq_competition.match_date','st_lq_competition.match_time','st_lq_competition.status','st_lq_competition.recommend')
+            $data = $this->join('st_lq_league','st_lq_competition.lg_id','=','st_lq_league.lg_id')
+                ->select('st_lq_competition.id','st_lq_competition.match_id','st_lq_competition.lg_id','st_lq_league.name_chinese','st_lq_league.last_time','st_lq_competition.home_team','st_lq_competition.guest_team','st_lq_competition.match_date','st_lq_competition.match_time','st_lq_competition.status','st_lq_competition.recommend')
                 ->orderby('st_lq_competition.match_date','desc')
                 ->orderby('st_lq_competition.match_time','desc')
                 ->where($where)
                 ->orwhere($orwhere)
                 ->paginate ($list);
         } else {
-            $data = $this->join('st_lq_league','st_lq_competition.lg_id','=','st_lq_league.id')
-                ->join('st_lq_local_match','st_lq_competition.id','=','st_lq_local_match.match_id')
-                ->join('st_lq_local_league','st_lq_league.id','=','st_lq_local_league.lg_id')
-                ->select('st_lq_competition.id','st_lq_local_match.match_id','st_lq_local_league.lg_id','st_lq_league.name_chinese','st_lq_league.last_time','st_lq_competition.home_team','st_lq_competition.guest_team','st_lq_competition.match_date','st_lq_competition.match_time','st_lq_competition.status','st_lq_competition.recommend')
+            $data = $this->join('st_lq_league','st_lq_competition.lg_id','=','st_lq_league.lg_id')
+                ->select('st_lq_competition.id','st_lq_competition.match_id','st_lq_competition.lg_id','st_lq_league.name_chinese','st_lq_league.last_time','st_lq_competition.home_team','st_lq_competition.guest_team','st_lq_competition.match_date','st_lq_competition.match_time','st_lq_competition.status','st_lq_competition.recommend')
                 ->orderby('st_lq_competition.match_date','desc')
                 ->orderby('st_lq_competition.match_time','desc')
                 ->paginate ($list);
         }
-
-
-
-//        if (is_array ($where) && count ($where) > 0) {
-//            $data = $this->join('st_lq_league','st_lq_competition.lg_id','=','st_lq_league.lg_id')
-//                ->select('st_lq_competition.id','st_lq_competition.match_id','st_lq_competition.lg_id','st_lq_league.name_chinese','st_lq_league.last_time','st_lq_competition.home_team','st_lq_competition.guest_team','st_lq_competition.match_date','st_lq_competition.match_time','st_lq_competition.status','st_lq_competition.recommend')
-//                ->orderby('st_lq_competition.match_date','desc')
-//                ->orderby('st_lq_competition.match_time','desc')
-//                ->where($where)
-//                ->orwhere($orwhere)
-//                ->paginate ($list);
-//        } else {
-//            $data = $this->join('st_lq_league','st_lq_competition.lg_id','=','st_lq_league.lg_id')
-//                ->select('st_lq_competition.id','st_lq_competition.match_id','st_lq_competition.lg_id','st_lq_league.name_chinese','st_lq_league.last_time','st_lq_competition.home_team','st_lq_competition.guest_team','st_lq_competition.match_date','st_lq_competition.match_time','st_lq_competition.status','st_lq_competition.recommend')
-//                ->orderby('st_lq_competition.match_date','desc')
-//                ->orderby('st_lq_competition.match_time','desc')
-//                ->paginate ($list);
-//        }
         if (!$data < 0) {
             return -2021052003; //
         }

+ 46 - 18
app/Models/SportsNoteList.php

@@ -15,8 +15,8 @@ class SportsNoteList extends BaseModel {
     {
         $data = $this
             ->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')
-            ->join('st_'.$type.'_competition','st_'.$type.'_competition.id','=','money_buy_simplex.match_id')
-            ->join('st_'.$type.'_league','st_'.$type.'_competition.lg_id','=','st_'.$type.'_league.id')
+            ->join('st_'.$type.'_competition','st_'.$type.'_competition.match_id','=','money_buy_simplex.match_id')
+            ->join('st_'.$type.'_league','st_'.$type.'_competition.lg_id','=','st_'.$type.'_league.lg_id')
             ->select('money_buy_simplex.id','money_buy_simplex.account_name','money_buy_simplex.account_identity','money_buy_simplex.order_id','money_buy_simplex.money','money_buy_simplex.prize_money','money_buy_simplex.status','money_buy_simplex.money_time','money_buy_simplex.settle_status','money_buy_simplex.gain_money','money_buy_simplex.game_code','money_buy_simplex.match_id','money_buy_simplex.game_status','st_'.$type.'_competition.home_team','st_'.$type.'_competition.guest_team','st_'.$type.'_competition.match_date','st_'.$type.'_competition.match_time','st_'.$type.'_competition.lg_id','money_details.money_cash','money_buy_simplex.batch_id','st_'.$type.'_league.name_chinese','st_'.$type.'_league.last_time')
             ->where($where)
             ->orderby('money_buy_simplex.money_time','desc')
@@ -33,6 +33,26 @@ class SportsNoteList extends BaseModel {
 
         //订单投注的玩法
         $content = \App\Models\MoneyBuyMatch::where('bet_type','1')->get();
+        for($d=0;$d<count($content);$d++){
+            if($content[$d]->result==0){
+                $content[$d]->result = '未处理';
+            }
+            if($content[$d]->result==1){
+                $content[$d]->result = '赢';
+            }
+            if($content[$d]->result==-1){
+                $content[$d]->result = '输';
+            }
+            if($content[$d]->result==2){
+                $content[$d]->result = '平';
+            }
+            if($content[$d]->result==3){
+                $content[$d]->result = '赢半平半';
+            }
+            if($content[$d]->result==4){
+                $content[$d]->result = '输半平半';
+            }
+        }
 
         //玩法
         $result = \App\Models\Matchcode::where('game_code','zq')->get();
@@ -40,8 +60,10 @@ class SportsNoteList extends BaseModel {
 
 
         for($i=0;$i<count($data);$i++){
-            if($data[$i]->status==1){
+            if($data[$i]->status==1 && $data[$i]->game_status==0){
                 $data[$i]->order_status = '投注'.'<br><a class="layui-btn layui-btn-sm invalid" lay-event="detail" pid="id" uri="/admin/SoccerNoteList/invalid/?id=" href="javascript:invalid(\'/admin/SoccerNoteList/invalid/?id='.$data[$i]->id.'\');"> 作废 </a>';
+            }else if($data[$i]->status==1 && $data[$i]->game_status!=0){
+                $data[$i]->order_status = '投注';
             }else if($data[$i]->status==2){
                 $data[$i]->order_status = '作废'.'<br><a class="layui-btn layui-btn-sm audit" lay-event="detail" pid="id" uri="" href="javascript:void(0)" style="background-color: grey;"> 已作废 </a>';
             }else if($data[$i]->status==3){
@@ -54,12 +76,8 @@ class SportsNoteList extends BaseModel {
             }
             if($data[$i]->game_status==0){
                 $data[$i]->game_status = '未处理';
-            }else if($data[$i]->game_status==1){
-                $data[$i]->game_status = '赢';
-            }else if($data[$i]->game_status==2){
-                $data[$i]->game_status = '输';
-            }else if($data[$i]->game_status==3){
-                $data[$i]->game_status = '平';
+            }else{
+                $data[$i]->game_status = '已处理';
             }
 
             $data[$i]->match_id_order = '<span>'.$data[$i]->match_id.'</span> (<span>'.$data[$i]->account_name.'</span>)<br>'.$data[$i]->order_id;
@@ -83,7 +101,7 @@ class SportsNoteList extends BaseModel {
                 }
             }
             if($data[$i]->water_return == -1){
-                $data[$i]->water_return == 0;
+                $data[$i]->water_return = 0;
                 //用户投注后账户金额
                 $data[$i]->frozen_cash = $data[$i]->money_cash;
             }
@@ -152,11 +170,21 @@ class SportsNoteList extends BaseModel {
                     for($c=0;$c<count($result);$c++){
                         if($content[$b]->odds_code == $result[$c]->odds_code){
                             $data[$i]->str1 = 1;
-                            $data[$i]->content = $data[$i]->content.$result[$c]->odds_name.'<br>'.$content[$b]->condition.' '.$data[$i]->team.'@'.$content[$b]->odds.' ¥'.$content[$b]->bet_money.'<br>';
+                            if($content[$b]->result=='未处理'){
+                                $data[$i]->content = $data[$i]->content.$result[$c]->odds_name.'<br>'.$content[$b]->condition.' '.$data[$i]->team.'@'.$content[$b]->odds.' ¥'.$content[$b]->bet_money.'<br>';
+                            }else{
+                                $data[$i]->content = $data[$i]->content.$result[$c]->odds_name.'<br>'.$content[$b]->condition.' '.$data[$i]->team.'@'.$content[$b]->odds.' ¥'.$content[$b]->bet_money.'<br><span>'.$content[$b]->result.'</span><br>';
+                            }
+
                         }
                     }
                     if($data[$i]->str1 == 0){
-                        $data[$i]->content = $data[$i]->content.$content[$b]->odds_code.'<br>'.$content[$b]->condition.' '.$data[$i]->team.'@'.$content[$b]->odds.' ¥'.$content[$b]->bet_money.'<br>';
+                        if($content[$b]->result=='未处理'){
+                            $data[$i]->content = $data[$i]->content.$content[$b]->odds_code.'<br>'.$content[$b]->condition.' '.$data[$i]->team.'@'.$content[$b]->odds.' ¥'.$content[$b]->bet_money.'<br>';
+                        }else{
+                            $data[$i]->content = $data[$i]->content.$content[$b]->odds_code.'<br>'.$content[$b]->condition.' '.$data[$i]->team.'@'.$content[$b]->odds.' ¥'.$content[$b]->bet_money.'<br><span>'.$content[$b]->result.'</span><br>';
+                        }
+
                     }
                 }
             }
@@ -185,15 +213,15 @@ class SportsNoteList extends BaseModel {
         $data['all_money'] = 0;
         $data['all_prize_money'] = 0;
         $data['alraedy_prize_money'] = 0;
-        $all_money = $this->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')->join('st_'.$type.'_competition','st_'.$type.'_competition.id','=','money_buy_simplex.match_id')->join('st_'.$type.'_league','st_'.$type.'_competition.lg_id','=','st_'.$type.'_league.id')->select('money_buy_simplex.money','money_buy_simplex.prize_money','money_buy_simplex.gain_money')->where('money_buy_simplex.status','1')->get();
+        $all_money = $this->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')->join('st_'.$type.'_competition','st_'.$type.'_competition.match_id','=','money_buy_simplex.match_id')->join('st_'.$type.'_league','st_'.$type.'_competition.lg_id','=','st_'.$type.'_league.lg_id')->select('money_buy_simplex.money','money_buy_simplex.prize_money','money_buy_simplex.gain_money')->where('money_buy_simplex.status','1')->get();
         for($a=0;$a<count($all_money);$a++){
             $data['all_money'] = $data['all_money']+$all_money[$a]->money;
         }
-        $all_prize_money = $this->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')->join('st_'.$type.'_competition','st_'.$type.'_competition.id','=','money_buy_simplex.match_id')->join('st_'.$type.'_league','st_'.$type.'_competition.lg_id','=','st_'.$type.'_league.id')->select('money_buy_simplex.money','money_buy_simplex.prize_money','money_buy_simplex.gain_money')->where('money_buy_simplex.status','1')->get();
+        $all_prize_money = $this->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')->join('st_'.$type.'_competition','st_'.$type.'_competition.match_id','=','money_buy_simplex.match_id')->join('st_'.$type.'_league','st_'.$type.'_competition.lg_id','=','st_'.$type.'_league.lg_id')->select('money_buy_simplex.money','money_buy_simplex.prize_money','money_buy_simplex.gain_money')->where('money_buy_simplex.status','1')->get();
         for($a=0;$a<count($all_prize_money);$a++){
             $data['all_prize_money'] = $data['all_money']+$all_prize_money[$a]->prize_money;
         }
-        $alraedy_prize_money = $this->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')->join('st_'.$type.'_competition','st_'.$type.'_competition.id','=','money_buy_simplex.match_id')->join('st_'.$type.'_league','st_'.$type.'_competition.lg_id','=','st_'.$type.'_league.id')->select('money_buy_simplex.money','money_buy_simplex.prize_money','money_buy_simplex.gain_money')->where('money_buy_simplex.settle_status','2')->where('money_buy_simplex.status','1')->get();
+        $alraedy_prize_money = $this->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')->join('st_'.$type.'_competition','st_'.$type.'_competition.match_id','=','money_buy_simplex.match_id')->join('st_'.$type.'_league','st_'.$type.'_competition.lg_id','=','st_'.$type.'_league.lg_id')->select('money_buy_simplex.money','money_buy_simplex.prize_money','money_buy_simplex.gain_money')->where('money_buy_simplex.settle_status','2')->where('money_buy_simplex.status','1')->get();
         for($a=0;$a<count($alraedy_prize_money);$a++){
             $data['alraedy_prize_money'] = $data['all_money']+$alraedy_prize_money[$a]->gain_money;
         }
@@ -205,15 +233,15 @@ class SportsNoteList extends BaseModel {
             //$data['all_money'] = $this->where($where)->sum('money');
 //            $data['all_prize_money'] = $this->where($where)->sum('prize_money');
 //            $data['alraedy_prize_money'] = $this->where($where)->where('settle_status','2')->sum('gain_money');
-            $all_money = $this->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')->join('st_zq_competition','st_zq_competition.id','=','money_buy_simplex.match_id')->join('st_zq_league','st_zq_competition.lg_id','=','st_zq_league.id')->select('money_buy_simplex.money','money_buy_simplex.prize_money','money_buy_simplex.gain_money')->where($where)->where('money_buy_simplex.status','1')->get();
+            $all_money = $this->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')->join('st_zq_competition','st_zq_competition.match_id','=','money_buy_simplex.match_id')->join('st_zq_league','st_zq_competition.lg_id','=','st_zq_league.lg_id')->select('money_buy_simplex.money','money_buy_simplex.prize_money','money_buy_simplex.gain_money')->where($where)->where('money_buy_simplex.status','1')->get();
             for($a=0;$a<count($all_money);$a++){
                 $data['all_money'] = $data['all_money']+$all_money[$a]->money;
             }
-            $all_prize_money = $this->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')->join('st_'.$type.'_competition','st_'.$type.'_competition.id','=','money_buy_simplex.match_id')->join('st_'.$type.'_league','st_'.$type.'_competition.lg_id','=','st_'.$type.'_league.id')->select('money_buy_simplex.money','money_buy_simplex.prize_money','money_buy_simplex.gain_money')->where($where)->where('money_buy_simplex.status','1')->get();
+            $all_prize_money = $this->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')->join('st_'.$type.'_competition','st_'.$type.'_competition.match_id','=','money_buy_simplex.match_id')->join('st_'.$type.'_league','st_'.$type.'_competition.lg_id','=','st_'.$type.'_league.lg_id')->select('money_buy_simplex.money','money_buy_simplex.prize_money','money_buy_simplex.gain_money')->where($where)->where('money_buy_simplex.status','1')->get();
             for($a=0;$a<count($all_prize_money);$a++){
                 $data['all_prize_money'] = $data['all_prize_money']+$all_prize_money[$a]->prize_money;
             }
-            $alraedy_prize_money = $this->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')->join('st_'.$type.'_competition','st_'.$type.'_competition.id','=','money_buy_simplex.match_id')->join('st_'.$type.'_league','st_'.$type.'_competition.lg_id','=','st_'.$type.'_league.id')->select('money_buy_simplex.money','money_buy_simplex.prize_money','money_buy_simplex.gain_money')->where('money_buy_simplex.settle_status','2')->where($where)->where('money_buy_simplex.status','1')->get();
+            $alraedy_prize_money = $this->join('money_details','money_details.info_identity','=','money_buy_simplex.info_identity')->join('st_'.$type.'_competition','st_'.$type.'_competition.match_id','=','money_buy_simplex.match_id')->join('st_'.$type.'_league','st_'.$type.'_competition.lg_id','=','st_'.$type.'_league.lg_id')->select('money_buy_simplex.money','money_buy_simplex.prize_money','money_buy_simplex.gain_money')->where('money_buy_simplex.settle_status','2')->where($where)->where('money_buy_simplex.status','1')->get();
             for($a=0;$a<count($alraedy_prize_money);$a++){
                 $data['alraedy_prize_money'] = $data['alraedy_prize_money']+$alraedy_prize_money[$a]->gain_money;
             }

+ 31 - 31
app/Models/SportsSoccer.php

@@ -49,49 +49,49 @@ class SportsSoccer extends BaseModel {
         
         $where[] = array('st_zq_league.name_chinese','<>','');
 
-        $source = \App\Models\Setinfo::where('id','1000')->first();
-        if($source->infocontent != '混合数据'){
-            $where[] = array('st_zq_local_match.source', '=', $source->infocontent);
-            $where[] = array('st_zq_local_league.source', '=', $source->infocontent);
-        }
-        if (is_array ($where) && count ($where) > 0) {
-            $data = $this->join('st_zq_league','st_zq_competition.lg_id','=','st_zq_league.id')
-                ->join('st_zq_local_match','st_zq_competition.id','=','st_zq_local_match.match_id')
-                ->join('st_zq_local_league','st_zq_league.id','=','st_zq_local_league.lg_id')
-                ->select('st_zq_competition.id','st_zq_local_match.match_id','st_zq_local_league.lg_id','st_zq_league.name_chinese','st_zq_league.last_time','st_zq_competition.home_team','st_zq_competition.guest_team','st_zq_competition.match_date','st_zq_competition.match_time','st_zq_competition.status','st_zq_competition.recommend')
-                ->orderby('st_zq_competition.match_date','desc')
-                ->orderby('st_zq_competition.match_time','desc')
-                ->where($where)
-                ->orwhere($orwhere)
-                ->paginate ($list);
-        } else {
-            $data = $this->join('st_zq_league','st_zq_competition.lg_id','=','st_zq_league.id')
-                ->join('st_zq_local_match','st_zq_competition.id','=','st_zq_local_match.match_id')
-                ->join('st_zq_local_league','st_zq_league.id','=','st_zq_local_league.lg_id')
-                ->select('st_zq_competition.id','st_zq_local_match.match_id','st_zq_local_league.lg_id','st_zq_league.name_chinese','st_zq_league.last_time','st_zq_competition.home_team','st_zq_competition.guest_team','st_zq_competition.match_date','st_zq_competition.match_time','st_zq_competition.status','st_zq_competition.recommend')
-                ->orderby('st_zq_competition.match_date','desc')
-                ->orderby('st_zq_competition.match_time','desc')
-                ->paginate ($list);
-        }
-
-
-
+//        $source = \App\Models\Setinfo::where('id','1000')->first();
+//        if($source->infocontent != '混合数据'){
+//            $where[] = array('st_zq_local_match.source', '=', $source->infocontent);
+//            $where[] = array('st_zq_local_league.source', '=', $source->infocontent);
+//        }
 //        if (is_array ($where) && count ($where) > 0) {
-//            $data = $this->join('st_zq_league','st_zq_competition.lg_id','=','st_zq_league.lg_id')
-//                ->select('st_zq_competition.id','st_zq_competition.match_id','st_zq_competition.lg_id','st_zq_league.name_chinese','st_zq_league.last_time','st_zq_competition.home_team','st_zq_competition.guest_team','st_zq_competition.match_date','st_zq_competition.match_time','st_zq_competition.status','st_zq_competition.recommend')
+//            $data = $this->join('st_zq_league','st_zq_competition.lg_id','=','st_zq_league.id')
+//                ->join('st_zq_local_match','st_zq_competition.id','=','st_zq_local_match.match_id')
+//                ->join('st_zq_local_league','st_zq_league.id','=','st_zq_local_league.lg_id')
+//                ->select('st_zq_competition.id','st_zq_local_match.match_id','st_zq_local_league.lg_id','st_zq_league.name_chinese','st_zq_league.last_time','st_zq_competition.home_team','st_zq_competition.guest_team','st_zq_competition.match_date','st_zq_competition.match_time','st_zq_competition.status','st_zq_competition.recommend')
 //                ->orderby('st_zq_competition.match_date','desc')
 //                ->orderby('st_zq_competition.match_time','desc')
 //                ->where($where)
 //                ->orwhere($orwhere)
 //                ->paginate ($list);
 //        } else {
-//            $data = $this->join('st_zq_league','st_zq_competition.lg_id','=','st_zq_league.lg_id')
-//                ->select('st_zq_competition.id','st_zq_competition.match_id','st_zq_competition.lg_id','st_zq_league.name_chinese','st_zq_league.last_time','st_zq_competition.home_team','st_zq_competition.guest_team','st_zq_competition.match_date','st_zq_competition.match_time','st_zq_competition.status','st_zq_competition.recommend')
+//            $data = $this->join('st_zq_league','st_zq_competition.lg_id','=','st_zq_league.id')
+//                ->join('st_zq_local_match','st_zq_competition.id','=','st_zq_local_match.match_id')
+//                ->join('st_zq_local_league','st_zq_league.id','=','st_zq_local_league.lg_id')
+//                ->select('st_zq_competition.id','st_zq_local_match.match_id','st_zq_local_league.lg_id','st_zq_league.name_chinese','st_zq_league.last_time','st_zq_competition.home_team','st_zq_competition.guest_team','st_zq_competition.match_date','st_zq_competition.match_time','st_zq_competition.status','st_zq_competition.recommend')
 //                ->orderby('st_zq_competition.match_date','desc')
 //                ->orderby('st_zq_competition.match_time','desc')
 //                ->paginate ($list);
 //        }
 
+
+
+        if (is_array ($where) && count ($where) > 0) {
+            $data = $this->join('st_zq_league','st_zq_competition.lg_id','=','st_zq_league.lg_id')
+                ->select('st_zq_competition.id','st_zq_competition.match_id','st_zq_competition.lg_id','st_zq_league.name_chinese','st_zq_league.last_time','st_zq_competition.home_team','st_zq_competition.guest_team','st_zq_competition.match_date','st_zq_competition.match_time','st_zq_competition.status','st_zq_competition.recommend')
+                ->orderby('st_zq_competition.match_date','desc')
+                ->orderby('st_zq_competition.match_time','desc')
+                ->where($where)
+                ->orwhere($orwhere)
+                ->paginate ($list);
+        } else {
+            $data = $this->join('st_zq_league','st_zq_competition.lg_id','=','st_zq_league.lg_id')
+                ->select('st_zq_competition.id','st_zq_competition.match_id','st_zq_competition.lg_id','st_zq_league.name_chinese','st_zq_league.last_time','st_zq_competition.home_team','st_zq_competition.guest_team','st_zq_competition.match_date','st_zq_competition.match_time','st_zq_competition.status','st_zq_competition.recommend')
+                ->orderby('st_zq_competition.match_date','desc')
+                ->orderby('st_zq_competition.match_time','desc')
+                ->paginate ($list);
+        }
+
         if (!$data < 0) {
             return -2021052003; //
         }

+ 31 - 31
app/Models/SportsTennis.php

@@ -49,49 +49,49 @@ class SportsTennis extends BaseModel {
         
         $where[] = array('st_wq_league.name_chinese','<>','');
 
-        $source = \App\Models\Setinfo::where('id','1000')->first();
-        if($source->infocontent != '混合数据'){
-            $where[] = array('st_wq_local_match.source', '=', $source->infocontent);
-            $where[] = array('st_wq_local_league.source', '=', $source->infocontent);
-        }
+//        $source = \App\Models\Setinfo::where('id','1000')->first();
+//        if($source->infocontent != '混合数据'){
+//            $where[] = array('st_wq_local_match.source', '=', $source->infocontent);
+//            $where[] = array('st_wq_local_league.source', '=', $source->infocontent);
+//        }
+//
+//        if (is_array ($where) && count ($where) > 0) {
+//            $data = $this->join('st_wq_league','st_wq_competition.lg_id','=','st_wq_league.id')
+//                ->join('st_wq_local_match','st_wq_competition.id','=','st_wq_local_match.match_id')
+//                ->join('st_wq_local_league','st_wq_league.id','=','st_wq_local_league.lg_id')
+//                ->select('st_wq_competition.id','st_wq_local_match.match_id','st_wq_local_league.lg_id','st_wq_league.name_chinese','st_wq_league.last_time','st_wq_competition.home_team','st_wq_competition.guest_team','st_wq_competition.match_date','st_wq_competition.match_time','st_wq_competition.status','st_wq_competition.recommend')
+//                ->orderby('st_wq_competition.match_date','desc')
+//                ->orderby('st_wq_competition.match_time','desc')
+//                ->where($where)
+//                ->orwhere($orwhere)
+//                ->paginate ($list);
+//        } else {
+//            $data = $this->join('st_wq_league','st_wq_competition.lg_id','=','st_wq_league.id')
+//                ->join('st_wq_local_match','st_wq_competition.id','=','st_wq_local_match.match_id')
+//                ->join('st_wq_local_league','st_wq_league.id','=','st_wq_local_league.lg_id')
+//                ->select('st_wq_competition.id','st_wq_local_match.match_id','st_wq_local_league.lg_id','st_wq_league.name_chinese','st_wq_league.last_time','st_wq_competition.home_team','st_wq_competition.guest_team','st_wq_competition.match_date','st_wq_competition.match_time','st_wq_competition.status','st_wq_competition.recommend')
+//                ->orderby('st_wq_competition.match_date','desc')
+//                ->orderby('st_wq_competition.match_time','desc')
+//                ->paginate ($list);
+//        }
+
+
 
         if (is_array ($where) && count ($where) > 0) {
-            $data = $this->join('st_wq_league','st_wq_competition.lg_id','=','st_wq_league.id')
-                ->join('st_wq_local_match','st_wq_competition.id','=','st_wq_local_match.match_id')
-                ->join('st_wq_local_league','st_wq_league.id','=','st_wq_local_league.lg_id')
-                ->select('st_wq_competition.id','st_wq_local_match.match_id','st_wq_local_league.lg_id','st_wq_league.name_chinese','st_wq_league.last_time','st_wq_competition.home_team','st_wq_competition.guest_team','st_wq_competition.match_date','st_wq_competition.match_time','st_wq_competition.status','st_wq_competition.recommend')
+            $data = $this->join('st_wq_league','st_wq_competition.lg_id','=','st_wq_league.lg_id')
+                ->select('st_wq_competition.id','st_wq_competition.match_id','st_wq_competition.lg_id','st_wq_league.name_chinese','st_wq_league.last_time','st_wq_competition.home_team','st_wq_competition.guest_team','st_wq_competition.match_date','st_wq_competition.match_time','st_wq_competition.status','st_wq_competition.recommend')
                 ->orderby('st_wq_competition.match_date','desc')
                 ->orderby('st_wq_competition.match_time','desc')
                 ->where($where)
                 ->orwhere($orwhere)
                 ->paginate ($list);
         } else {
-            $data = $this->join('st_wq_league','st_wq_competition.lg_id','=','st_wq_league.id')
-                ->join('st_wq_local_match','st_wq_competition.id','=','st_wq_local_match.match_id')
-                ->join('st_wq_local_league','st_wq_league.id','=','st_wq_local_league.lg_id')
-                ->select('st_wq_competition.id','st_wq_local_match.match_id','st_wq_local_league.lg_id','st_wq_league.name_chinese','st_wq_league.last_time','st_wq_competition.home_team','st_wq_competition.guest_team','st_wq_competition.match_date','st_wq_competition.match_time','st_wq_competition.status','st_wq_competition.recommend')
+            $data = $this->join('st_wq_league','st_wq_competition.lg_id','=','st_wq_league.lg_id')
+                ->select('st_wq_competition.id','st_wq_competition.match_id','st_wq_competition.lg_id','st_wq_league.name_chinese','st_wq_league.last_time','st_wq_competition.home_team','st_wq_competition.guest_team','st_wq_competition.match_date','st_wq_competition.match_time','st_wq_competition.status','st_wq_competition.recommend')
                 ->orderby('st_wq_competition.match_date','desc')
                 ->orderby('st_wq_competition.match_time','desc')
                 ->paginate ($list);
         }
-
-
-
-//        if (is_array ($where) && count ($where) > 0) {
-//            $data = $this->join('st_wq_league','st_wq_competition.lg_id','=','st_wq_league.lg_id')
-//                ->select('st_wq_competition.id','st_wq_competition.match_id','st_wq_competition.lg_id','st_wq_league.name_chinese','st_wq_league.last_time','st_wq_competition.home_team','st_wq_competition.guest_team','st_wq_competition.match_date','st_wq_competition.match_time','st_wq_competition.status','st_wq_competition.recommend')
-//                ->orderby('st_wq_competition.match_date','desc')
-//                ->orderby('st_wq_competition.match_time','desc')
-//                ->where($where)
-//                ->orwhere($orwhere)
-//                ->paginate ($list);
-//        } else {
-//            $data = $this->join('st_wq_league','st_wq_competition.lg_id','=','st_wq_league.lg_id')
-//                ->select('st_wq_competition.id','st_wq_competition.match_id','st_wq_competition.lg_id','st_wq_league.name_chinese','st_wq_league.last_time','st_wq_competition.home_team','st_wq_competition.guest_team','st_wq_competition.match_date','st_wq_competition.match_time','st_wq_competition.status','st_wq_competition.recommend')
-//                ->orderby('st_wq_competition.match_date','desc')
-//                ->orderby('st_wq_competition.match_time','desc')
-//                ->paginate ($list);
-//        }
         if (!$data < 0) {
             return -2021052003; //
         }

+ 9 - 9
app/Models/TennisLeague.php

@@ -14,21 +14,21 @@ class TennisLeague extends BaseModel {
 
     function getinfo($list = 10, $page, $where = '')
     {
-        $source = \App\Models\Setinfo::where('id','1000')->first();
-        if($source->infocontent != '混合数据'){
-            $where[] = array('st_wq_local_league.source', '=', $source->infocontent);
-        }
+//        $source = \App\Models\Setinfo::where('id','1000')->first();
+//        if($source->infocontent != '混合数据'){
+//            $where[] = array('st_wq_local_league.source', '=', $source->infocontent);
+//        }
         if (is_array ($where) && count ($where) > 0){
             $data = $this
-                ->join('st_wq_local_league','st_wq_league.id','=','st_wq_local_league.lg_id')
-                ->select('st_wq_league.id','st_wq_league.name_chinese','st_wq_league.area_id','st_wq_league.country_id','st_wq_league.status','st_wq_league.utime')
+                //->join('st_wq_local_league','st_wq_league.id','=','st_wq_local_league.lg_id')
+                ->select('st_wq_league.lg_id','st_wq_league.name_chinese','st_wq_league.area_id','st_wq_league.country_id','st_wq_league.utime')
                 ->orderby('st_wq_league.utime','desc')
                 ->where($where)
                 ->paginate ($list);
         }else{
             $data = $this
-                ->join('st_wq_local_league','st_wq_league.id','=','st_wq_local_league.lg_id')
-                ->select('st_wq_league.id','st_wq_league.name_chinese','st_wq_league.area_id','st_wq_league.country_id','st_wq_league.status','st_wq_league.utime')
+                //->join('st_wq_local_league','st_wq_league.id','=','st_wq_local_league.lg_id')
+                ->select('st_wq_league.lg_id','st_wq_league.name_chinese','st_wq_league.area_id','st_wq_league.country_id','st_wq_league.utime')
                 ->orderby('st_wq_league.utime','desc')
                 ->orderby('utime','desc')
                 ->paginate ($list);
@@ -46,7 +46,7 @@ class TennisLeague extends BaseModel {
         $country = \App\Models\StAreaCountry::where('pid','<>','0')->get();
 
         for($i=0;$i<count($data);$i++){
-            //$data[$i]->id = $data[$i]->lg_id;
+            $data[$i]->id = $data[$i]->lg_id;
 
             if($data[$i]->status == '-1'){
                 $data[$i]->league_status = '未启用';

+ 1 - 1
resources/views/admin/sportsfoot/addoutcome.blade.php

@@ -148,7 +148,7 @@
                     <select name="lg_id"  id="lg_id" lay-filter = 'sect'  lay-verify="required" autocomplete="off" class="layui-input"  eventType=event-query>
                         <option value="">{{ trans('sportsfoot.lg_select') }}</option>
                         @foreach($data as $k=>$v)
-                            <option value="{{$v['id']}}">{{$v['name_chinese']}}</option>
+                            <option value="{{$v['lg_id']}}">{{$v['name_chinese']}}</option>
                         @endforeach
                     </select>
                 </div>

+ 210 - 2
resources/views/admin/sportsfoot/outcome.blade.php

@@ -21,6 +21,105 @@
             width: auto;
         }
     </style>
+	
+	 <!-- 样式 -->
+	<style type="text/css">
+		/* 弹窗 (background) */
+		.modal {
+			display: none; /* 默认隐藏 */
+			/*生成绝对定位的元素,相对于浏览器窗口进行定位。*/
+			position: fixed; 
+			z-index: 1; 
+			left: 0;
+			top: 0;
+			/*设置弹窗位置*/
+			padding-top: 200px;
+			padding-bottom: 300px;
+			/*浮在全屏上*/
+			width: 100%; 
+			height:  100%; 
+			/*overflow:auto;如果内容被修剪,则浏览器会显示滚动条,以便查看其余内容。*/
+			overflow: auto; 
+			background-color: rgb(0,0,0); 
+			background-color: rgba(0,0,0,0.4);
+			text-align: right;
+		}
+
+		/* 弹窗内容 */
+		.modal-content {
+			/*position: relative;*/
+			/*弹窗背景色设置*/
+			background-color: #fefefe;
+			margin: auto;
+			padding: 260px auto;
+			width: 500px;
+			box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
+			-webkit-animation-name: animatetop;
+			-webkit-animation-duration: 0.4s;
+			animation-name: animatetop;
+			animation-duration: 0.4s;
+			border-radius: 10px;
+		   }
+
+		/* 添加动画 */
+		@-webkit-keyframes animatetop {
+			from {top:-200px; opacity:0} 
+			to {top:0; opacity:1}
+		}
+
+		@keyframes animatetop {
+			from {top:-200px; opacity:0}
+			to {top:0; opacity:1}
+		}
+
+		/* 关闭按钮 */
+		.close {
+			color: white;
+			float: right;
+			font-size: 28px;
+			font-weight: bold;
+		}
+
+		.close:hover, .close:focus {
+			color: #000;
+			text-decoration: none;
+			cursor: pointer;
+		}
+
+		.modal-header {
+			display: block;
+			line-height: 30px;
+			padding: 2px 10px;
+			background-color: #AEAEAE;
+			color: white;
+			text-align: left;
+			border-radius: 5px 5px 0 0;
+		}
+
+		.modal-body {
+			padding: 2px 16px;
+			font-size: 18px;
+			height: 200px;
+		}
+
+		.modal-footer {
+			display: flex;
+			justify-content: space-around;
+			align-items: center;
+			width: 420px;
+			padding: 0 40px;
+			height: 50px;
+		   border-radius:0 0 5px 5px;
+			display: block;
+			line-height: 39px;
+			background-color: #AEAEAE;
+			color: white;
+		}
+		.ok,.no{
+			width: 100px;
+			height: 40px;
+		}
+	</style>
 
     <script type="text/html" id="newtime">
       @{{#if(d.match_id!=null){ }}
@@ -42,6 +141,7 @@
     </script>
 
     <script type="text/html" id="status">
+		<button onclick="addResult(@{{d.match_id}})" class="layui-btn layui-btn-sm layui-btn-green set">赛事结果</button>
         @{{#if(d.status==2 || d.status==3){ }}
             @{{#if(d.status==2){ }}
                 <span><li class="layui-btn layui-btn-sm layui-btn-green set" onclick="settlement(@{{d.match_id}},1)">结算</li></span>
@@ -163,14 +263,45 @@
                     <div class="layui-inline">
                         <a class="layui-btn layui-btn-sm lay-btn-diy"   data-type="reload" eventType="event-query-submit" style="opacity: 1; pointer-events: auto;">提交</a>
                         <a  class="layui-btn   layui-btn-sm layui-btn-normal reset" data-type="reload" style="opacity: 1; pointer-events: auto;">重置</a>
-                        <a class="layui-btn layui-btn-sm layui-btn-green set" data-type="reload" style="opacity: 1; pointer-events: auto;"><i class="layui-icon" onclick="refreshall('zq')"></i></a>
-                        @if(checkRriv('/admin/sportsfoot/addoutcome'))<a href="/admin/sportsfoot/addoutcome" class="layui-btn layui-btn-sm ">添加</a>@endif
+                        <a class="layui-btn layui-btn-sm layui-btn-green set" data-type="reload" style="opacity: 1; pointer-events: auto;"><i class="layui-icon" onclick="refreshall('zq')">刷新赛事</i></a>
+                        <!-- @if(checkRriv('/admin/sportsfoot/addoutcome'))<a href="/admin/sportsfoot/addoutcome" class="layui-btn layui-btn-sm ">添加</a>@endif -->
                         @if(checkRriv('/admin/sportsfoot/deleteoutcome'))<a href="javascript:delWin('/admin/sportsfoot/deleteoutcome?id=');" class="layui-btn layui-btn-sm  layui-btn-danger">删除</a>@endif
                     </div>
                 </div>
             </form>
         </div>
     </div>
+	
+	<!-- 弹窗隐藏区域 -->
+    <div id="myModal" class="modal">
+            <input type="hidden" id="match_id" name="match_id" value="@{{d.match_id}}">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <span class="close">&times;</span>
+                    <h2>赛事结果添加</h2>
+                </div>
+                <div class="modal-body">
+                    <p style="text-align:left;">请认真填写赛事结果,将会按照改结果结算</p><br>
+                    <div style="float:left">
+                        <p>最先进球球队:</p>
+                        <p>最后进球球队:</p>
+                        <p>获 胜 球 队:</p>
+                        <p>上主队进球数:</p>
+                        <p>上客队进球数:</p>
+                    </div>
+                    <div style="text-align:left;">
+                        <input type="text" id="firstscore" name="firstscore" value=""><br>
+                        <input type="text" id="lastscore" name="lastscore" value=""><br>
+                        <input type="text" id="matchwiner" name="matchwiner" value=""><br>
+                        <input type="text" id="uhomescore" name="uhomescore" value=""><br>
+                        <input type="text" id="uguestscore" name="uguestscore" value=""><br>
+                    </div>
+                </div>
+                <div class="modal-footer">
+                    <button class="ok" onchange="buttonClick()"><h3>确定</h3></button>&nbsp;<button class="no"><h3>取消</h3></button>
+                </div>
+            </div>
+    </div>
 
     <script type="text/javascript">
         $(function () {
@@ -188,6 +319,83 @@
             	}
             })
         })
+		
+		function addResult($match_id){
+            var match_id = $match_id;
+            document.getElementById("match_id").value=$match_id;//赋值个弹窗
+
+            $.ajax({
+                type: 'POST',
+                dataType: 'json',
+                url: '/admin/Sportsfoot/Matchresult',
+                data: {match_id:match_id},
+                success: function(data) {
+                    document.getElementById("firstscore").value=data.first_score;
+                    document.getElementById("lastscore").value=data.last_score;
+                    document.getElementById("matchwiner").value=data.match_winer;
+                    document.getElementById("uhomescore").value=data.u_home_score;
+                    document.getElementById("uguestscore").value=data.u_guest_score;
+                }
+            })
+
+            //获取弹窗得div
+            var modal = document.getElementById('myModal');
+            // 获取 <span> 元素,用于关闭弹窗 (X)
+            var span = document.getElementsByClassName("close")[0];
+            //获取弹窗中得确定按钮
+            var ok=document.getElementsByClassName("ok")[0];
+            //获取弹窗中得取消按钮
+            var no=document.getElementsByClassName("no")[0];
+            //窗体弹出
+            modal.style.display = "block";
+            //点击窗体ok
+            ok.onclick=function(){
+                //执行弹出窗体得确定后得操作
+                alert("执行确定按钮点击得操作");
+                //关闭窗口
+                modal.style.display = "none";
+                buttonClick();
+            }
+            //点击窗体取消按钮
+            no.onclick=function(){
+                //直接关闭窗口
+                modal.style.display = "none";
+            }
+            // 点击 <span> (x), 关闭弹窗
+            span.onclick = function() {
+                //直接关闭窗口
+                modal.style.display = "none";
+            }
+            // 在用户点击其他地方时,关闭弹窗
+            window.onclick = function(event) {
+                //点击窗口外内容,关闭窗口
+                if (event.target == modal) modal.style.display = "none";
+            }
+        }
+
+        function buttonClick(){
+            var match_id = $("#match_id").val();
+            var firstscore = $("#firstscore").val();
+            var lastscore = $("#lastscore").val();
+            var matchwiner = $("#matchwiner").val();
+            var uhomescore = $("#uhomescore").val();
+            var uguestscore = $("#uguestscore").val();
+
+            $.ajax({
+                type: 'POST',
+                dataType: 'json',
+                url: '/admin/Sportsfoot/addend',
+                data: {match_id:match_id,firstscore:firstscore,lastscore:lastscore,matchwiner:matchwiner,uhomescore:uhomescore,uguestscore:uguestscore},
+                success: function(data) {
+                    
+                    if(data.status==1){
+                        layer.msg(data.msg);
+                        location. reload()//刷新当前页面
+                    }
+                }
+            })
+        }
+
 
         //刷新赛事数据
         function refreshall(game_code){ 

+ 1 - 1
resources/views/sports/base_form.blade.php

@@ -76,7 +76,7 @@
                     <option value></option>
                     @if(isset($parents))
                         @foreach($parents as $k=>$v)
-                            <option value="{{ $v['id'] }}"  @if(isset($lg_id)&&$lg_id==$v['id'])  selected @endif>
+                            <option value="{{ $v['lg_id'] }}"  @if(isset($lg_id)&&$lg_id==$v['lg_id'])  selected @endif>
                                 @if(isset($lange[$v['name_chinese']]))  {{$lange[trim($v['name_chinese'])]}} @else {{$v['name_chinese']}}   @endif
                             </option>
                         @endforeach

+ 2 - 2
resources/views/sports/base_odds.blade.php

@@ -39,7 +39,7 @@
                     <div class="layui-inline">
                         <label class="layui-form-label">{{ trans('sportssoccer.match_id') }}</label>
                         <div class="layui-input-inline">
-                            <input type="text" name="id" id="id" eventType="event-query"  value="{{ $id }}" lay-verify="required" autocomplete="off" class="layui-input" readonly="readonly">
+                            <input type="text" name="id" id="id" eventType="event-query"  value="{{ $match_id }}" lay-verify="required" autocomplete="off" class="layui-input" readonly="readonly">
                         </div>
                         {{--<div class="layui-input-inline checkbox">--}}
                         {{--<input type="checkbox" name="sureblur" id="sureblur" lay-skin="switch" lay-text="精确|模糊" checked>--}}
@@ -83,7 +83,7 @@
                         <a class="layui-btn layui-btn-sm lay-btn-diy"   data-type="reload" eventType="event-query-submit" style="opacity: 1; pointer-events: auto;">提交</a>
                         <a  class="layui-btn   layui-btn-sm layui-btn-normal reset" data-type="reload" style="opacity: 1; pointer-events: auto;">重置</a>
                         <a class="layui-btn layui-btn-sm layui-btn-green set" data-type="reload" style="opacity: 1; pointer-events: auto;"><i class="layui-icon">ဂ</i></a>
-                        @if(checkRriv('/admin/SportsBase/addodds'))<a href="/admin/SportsBase/addodds?{{ $id }}" class="layui-btn layui-btn-sm ">添加</a>@endif
+                        @if(checkRriv('/admin/SportsBase/addodds'))<a href="/admin/SportsBase/addodds?{{ $match_id }}" class="layui-btn layui-btn-sm ">添加</a>@endif
                         @if(checkRriv('/admin/SportsBase/oddsdelete'))<a href="javascript:delWin('/admin/SportsBase/oddsdelete?id=');" class="layui-btn layui-btn-sm  layui-btn-danger">删除</a>@endif
                     </div>
 

+ 1 - 1
resources/views/sports/basket_form.blade.php

@@ -76,7 +76,7 @@
                     <option value></option>
                     @if(isset($parents))
                         @foreach($parents as $k=>$v)
-                            <option value="{{ $v['id'] }}"  @if(isset($lg_id)&&$lg_id==$v['id'])  selected @endif>
+                            <option value="{{ $v['lg_id'] }}"  @if(isset($lg_id)&&$lg_id==$v['lg_id'])  selected @endif>
                                 @if(isset($lange[$v['name_chinese']]))  {{$lange[trim($v['name_chinese'])]}} @else {{$v['name_chinese']}}   @endif
                             </option>
                         @endforeach

+ 2 - 2
resources/views/sports/basket_odds.blade.php

@@ -39,7 +39,7 @@
                     <div class="layui-inline">
                         <label class="layui-form-label">{{ trans('sportssoccer.match_id') }}</label>
                         <div class="layui-input-inline">
-                            <input type="text" name="id" id="id" eventType="event-query"  value="{{ $id }}" lay-verify="required" autocomplete="off" class="layui-input" readonly="readonly">
+                            <input type="text" name="id" id="id" eventType="event-query"  value="{{ $match_id }}" lay-verify="required" autocomplete="off" class="layui-input" readonly="readonly">
                         </div>
                         {{--<div class="layui-input-inline checkbox">--}}
                         {{--<input type="checkbox" name="sureblur" id="sureblur" lay-skin="switch" lay-text="精确|模糊" checked>--}}
@@ -83,7 +83,7 @@
                         <a class="layui-btn layui-btn-sm lay-btn-diy"   data-type="reload" eventType="event-query-submit" style="opacity: 1; pointer-events: auto;">提交</a>
                         <a  class="layui-btn   layui-btn-sm layui-btn-normal reset" data-type="reload" style="opacity: 1; pointer-events: auto;">重置</a>
                         <a class="layui-btn layui-btn-sm layui-btn-green set" data-type="reload" style="opacity: 1; pointer-events: auto;"><i class="layui-icon">ဂ</i></a>
-                        @if(checkRriv('/admin/SportsBasket/addodds'))<a href="/admin/SportsBasket/addodds?{{ $id }}" class="layui-btn layui-btn-sm ">添加</a>@endif
+                        @if(checkRriv('/admin/SportsBasket/addodds'))<a href="/admin/SportsBasket/addodds?{{ $match_id }}" class="layui-btn layui-btn-sm ">添加</a>@endif
                         @if(checkRriv('/admin/SportsBasket/oddsdelete'))<a href="javascript:delWin('/admin/SportsBasket/oddsdelete?id=');" class="layui-btn layui-btn-sm  layui-btn-danger">删除</a>@endif
                     </div>
 

+ 1 - 1
resources/views/sports/soccer_form.blade.php

@@ -76,7 +76,7 @@
                     <option value></option>
                     @if(isset($parents))
                         @foreach($parents as $k=>$v)
-                            <option value="{{ $v['id'] }}"  @if(isset($lg_id)&&$lg_id==$v['id'])  selected @endif>
+                            <option value="{{ $v['lg_id'] }}"  @if(isset($lg_id)&&$lg_id==$v['lg_id'])  selected @endif>
                                 @if(isset($lange[$v['name_chinese']]))  {{$lange[trim($v['name_chinese'])]}} @else {{$v['name_chinese']}}   @endif
                             </option>
                         @endforeach

+ 2 - 2
resources/views/sports/soccer_odds.blade.php

@@ -39,7 +39,7 @@
                     <div class="layui-inline">
                         <label class="layui-form-label">{{ trans('sportssoccer.match_id') }}</label>
                         <div class="layui-input-inline">
-                            <input type="text" name="id" id="id" eventType="event-query"  value="{{ $id }}" lay-verify="required" autocomplete="off" class="layui-input" readonly="readonly">
+                            <input type="text" name="id" id="id" eventType="event-query"  value="{{ $match_id }}" lay-verify="required" autocomplete="off" class="layui-input" readonly="readonly">
                         </div>
                         {{--<div class="layui-input-inline checkbox">--}}
                             {{--<input type="checkbox" name="sureblur" id="sureblur" lay-skin="switch" lay-text="精确|模糊" checked>--}}
@@ -83,7 +83,7 @@
                         <a class="layui-btn layui-btn-sm lay-btn-diy"   data-type="reload" eventType="event-query-submit" style="opacity: 1; pointer-events: auto;">提交</a>
                         <a  class="layui-btn   layui-btn-sm layui-btn-normal reset" data-type="reload" style="opacity: 1; pointer-events: auto;">重置</a>
                         <a class="layui-btn layui-btn-sm layui-btn-green set" data-type="reload" style="opacity: 1; pointer-events: auto;"><i class="layui-icon">ဂ</i></a>
-                        @if(checkRriv('/admin/SportsSoccer/addodds'))<a href="/admin/SportsSoccer/addodds?{{ $id }}" class="layui-btn layui-btn-sm ">添加</a>@endif
+                        @if(checkRriv('/admin/SportsSoccer/addodds'))<a href="/admin/SportsSoccer/addodds?{{ $match_id }}" class="layui-btn layui-btn-sm ">添加</a>@endif
                         @if(checkRriv('/admin/SportsSoccer/oddsdelete'))<a href="javascript:delWin('/admin/SportsSoccer/oddsdelete?id=');" class="layui-btn layui-btn-sm  layui-btn-danger">删除</a>@endif
                     </div>
 

+ 1 - 1
resources/views/sports/tennis_form.blade.php

@@ -76,7 +76,7 @@
                     <option value></option>
                     @if(isset($parents))
                         @foreach($parents as $k=>$v)
-                            <option value="{{ $v['id'] }}"  @if(isset($lg_id)&&$lg_id==$v['id'])  selected @endif>
+                            <option value="{{ $v['lg_id'] }}"  @if(isset($lg_id)&&$lg_id==$v['lg_id'])  selected @endif>
                                 @if(isset($lange[$v['name_chinese']]))  {{$lange[trim($v['name_chinese'])]}} @else {{$v['name_chinese']}}   @endif
                             </option>
                         @endforeach

+ 2 - 2
resources/views/sports/tennis_odds.blade.php

@@ -39,7 +39,7 @@
                     <div class="layui-inline">
                         <label class="layui-form-label">{{ trans('sportssoccer.match_id') }}</label>
                         <div class="layui-input-inline">
-                            <input type="text" name="id" id="id" eventType="event-query"  value="{{ $id }}" lay-verify="required" autocomplete="off" class="layui-input" readonly="readonly">
+                            <input type="text" name="id" id="id" eventType="event-query"  value="{{ $match_id }}" lay-verify="required" autocomplete="off" class="layui-input" readonly="readonly">
                         </div>
                         {{--<div class="layui-input-inline checkbox">--}}
                         {{--<input type="checkbox" name="sureblur" id="sureblur" lay-skin="switch" lay-text="精确|模糊" checked>--}}
@@ -83,7 +83,7 @@
                         <a class="layui-btn layui-btn-sm lay-btn-diy"   data-type="reload" eventType="event-query-submit" style="opacity: 1; pointer-events: auto;">提交</a>
                         <a  class="layui-btn   layui-btn-sm layui-btn-normal reset" data-type="reload" style="opacity: 1; pointer-events: auto;">重置</a>
                         <a class="layui-btn layui-btn-sm layui-btn-green set" data-type="reload" style="opacity: 1; pointer-events: auto;"><i class="layui-icon">ဂ</i></a>
-                        @if(checkRriv('/admin/SportsTennis/addodds'))<a href="/admin/SportsTennis/addodds?{{ $id }}" class="layui-btn layui-btn-sm ">添加</a>@endif
+                        @if(checkRriv('/admin/SportsTennis/addodds'))<a href="/admin/SportsTennis/addodds?{{ $match_id }}" class="layui-btn layui-btn-sm ">添加</a>@endif
                         @if(checkRriv('/admin/SportsTennis/oddsdelete'))<a href="javascript:delWin('/admin/SportsTennis/oddsdelete?id=');" class="layui-btn layui-btn-sm  layui-btn-danger">删除</a>@endif
                     </div>