|
|
@@ -156,22 +156,7 @@ class SportsBaseController extends Controller {
|
|
|
}
|
|
|
return $data->toArray();
|
|
|
}
|
|
|
- /**
|
|
|
- *获取所有国家信息
|
|
|
- */
|
|
|
- function getCountry() {
|
|
|
- $data = \App\Models\Country::select('country_id','name_chinese')->get();
|
|
|
- if (!$data) {
|
|
|
- return;
|
|
|
- }
|
|
|
- for($i=0;$i<count($data);$i++){
|
|
|
- $data[$i]->home_country_name = $data[$i]->name_chinese;
|
|
|
- $data[$i]->home_country_id = $data[$i]->country_id;
|
|
|
- $data[$i]->guest_country_name = $data[$i]->name_chinese;
|
|
|
- $data[$i]->guest_country_id = $data[$i]->country_id;
|
|
|
- }
|
|
|
- return $data->toArray();
|
|
|
- }
|
|
|
+
|
|
|
/**
|
|
|
*获取国家的球队信息
|
|
|
*/
|
|
|
@@ -187,8 +172,6 @@ class SportsBaseController extends Controller {
|
|
|
function add(Req $req) {
|
|
|
if (!$req->isMethod('post')) {
|
|
|
$parents = $this->getParent();
|
|
|
- $country = $this->getCountry();
|
|
|
- $countrys = $this->getCountry();
|
|
|
$lange = trans('menu');
|
|
|
foreach ($parents as $k => $v) {
|
|
|
$arr = trim($parents[$k]['name_chinese']);
|
|
|
@@ -197,8 +180,6 @@ class SportsBaseController extends Controller {
|
|
|
}
|
|
|
}
|
|
|
$data['parents'] = $parents;
|
|
|
- $data['country'] = $country;
|
|
|
- $data['countrys'] = $countrys;
|
|
|
return view('sports.base_form', $data);
|
|
|
} else {
|
|
|
$model = new \App\Models\SportsBase();
|
|
|
@@ -258,8 +239,6 @@ class SportsBaseController extends Controller {
|
|
|
return -1;
|
|
|
}
|
|
|
if (!$req->isMethod('post')) {
|
|
|
- $country = $this->getCountry();
|
|
|
- $countrys = $this->getCountry();
|
|
|
$data = \App\Models\SportsBase::where('id', $id)->first();
|
|
|
if (!$data) {
|
|
|
return -2;
|
|
|
@@ -297,23 +276,21 @@ class SportsBaseController extends Controller {
|
|
|
$match_status =array(['status'=>6,'name'=>'取消']);
|
|
|
}
|
|
|
|
|
|
- $name_chinese = \App\Models\BaseLeague::where('id', $data->lg_id)->first();
|
|
|
- $data->name_chinese = $name_chinese->name_chinese;
|
|
|
- $data = $data->toArray();
|
|
|
+ // $name_chinese = \App\Models\BaseLeague::where('id', $data->lg_id)->first();
|
|
|
+ // $data->name_chinese = $name_chinese->name_chinese;
|
|
|
+ // $data = $data->toArray();
|
|
|
$data['parents'] = $this->getParent();
|
|
|
- $data['country'] = $country;
|
|
|
- $data['countrys'] = $countrys;
|
|
|
|
|
|
$data['match_status'] = $match_status;
|
|
|
|
|
|
|
|
|
//$lange = trans('menu');
|
|
|
- foreach ($data['parents'] as $k => $v) {
|
|
|
- $arr = trim($data['parents'][$k]['name_chinese']);
|
|
|
- if (isset($lange[$arr])) {
|
|
|
- $data['parents'][$k]['name_chinese']=$lange[$arr];
|
|
|
- }
|
|
|
- }
|
|
|
+ // foreach ($data['parents'] as $k => $v) {
|
|
|
+ // $arr = trim($data['parents'][$k]['name_chinese']);
|
|
|
+ // if (isset($lange[$arr])) {
|
|
|
+ // $data['parents'][$k]['name_chinese']=$lange[$arr];
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
return view('sports.base_form', $data);
|
|
|
} else {
|