Commit a185017b authored by 章建武's avatar 章建武

dep

parent 4d7ec620
......@@ -4,6 +4,7 @@ use App\Http\Controllers\Controller;
use Moell\LayuiAdmin\Models\IndexAbout;
use Moell\LayuiAdmin\Models\AddManager;
use Illuminate\Support\Facades\Storage;
use Moell\LayuiAdmin\Models\IndexNavigation;
/**
* Created by PhpStorm.
* User: Administrator
......@@ -22,9 +23,15 @@ class AboutController extends Controller
if($en == 'en'){
$language_type = 1;
$en_url = $_SERVER['REQUEST_URI'];
$zh_url = substr($_SERVER['REQUEST_URI'],3);
}else{
$language_type = 0;
$en_url = '/en'.$_SERVER['REQUEST_URI'];
$zh_url = $_SERVER['REQUEST_URI'];
}
$zh = $zh_url;
$en = $en_url;
$about = IndexAbout::query()
->where('language_type',$language_type)
->orderBy('sequence', 'asc')
......@@ -34,7 +41,30 @@ class AboutController extends Controller
->where('language_type',$language_type)
->orderBy('sort','asc')
->get();
return view('index.about.about', compact('about'))->with('manager', $manager);
$navigation = IndexNavigation::query()
->where('is_link',0)
->where('parent_id',0)
->where('is_show',0)
->where('language_type',$language_type)
->orderBy('id', 'asc')
->get()
->toArray();
foreach ($navigation as $k => &$v){
$children = IndexNavigation::query()
->where('is_link',0)
->where('is_show',0)
->where('parent_id',$v['id'])
->get()
->toArray();
$v['children'] = $children;
}
return view('index.about.about', compact('about'))
->with('IndexNav',$navigation)
->with('language_type',$language_type)
->with('zh',$zh)
->with('en',$en)
->with('manager', $manager);
}
public function groupStrategy()
......
......@@ -100,7 +100,7 @@ class IndexController extends Controller
$v['children'] = $children;
}
return view('index.index')
return view('Index.index')
->with('banner1',$banner1)
->with('banner2',$banner2)
->with('banner3',$banner3)
......
......@@ -61,7 +61,7 @@
<span class="sr-only">Toggle navigation</span>
<i class="icon-menu"></i>
</button>
<a class="language" style="cursor: pointer" href="{{url('index')}}">
<a class="language" style="cursor: pointer" href="{{url('')}}">
<span class="zh">中文</span>
</a>
<a class="language1" style="cursor: pointer;" href="{{url('en/index')}}" >
......@@ -83,7 +83,7 @@
<a href="{{url('en/index')}}">Home</a>
@else
<a href="{{url('index')}}">首页</a>
<a href="{{url('')}}">首页</a>
@endif
</li>
@foreach($IndexNav as $topNav)
......
......@@ -82,7 +82,7 @@
@if($language_type == 1)
<a href="{{url('en/index')}}">Home</a>
@else
<a href="{{url('index')}}">首页</a>
<a href="{{url('')}}">首页</a>
@endif
</li>
@foreach($IndexNav as $topNav)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment