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

dep

parent 4d7ec620
...@@ -4,6 +4,7 @@ use App\Http\Controllers\Controller; ...@@ -4,6 +4,7 @@ use App\Http\Controllers\Controller;
use Moell\LayuiAdmin\Models\IndexAbout; use Moell\LayuiAdmin\Models\IndexAbout;
use Moell\LayuiAdmin\Models\AddManager; use Moell\LayuiAdmin\Models\AddManager;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
use Moell\LayuiAdmin\Models\IndexNavigation;
/** /**
* Created by PhpStorm. * Created by PhpStorm.
* User: Administrator * User: Administrator
...@@ -22,9 +23,15 @@ class AboutController extends Controller ...@@ -22,9 +23,15 @@ class AboutController extends Controller
if($en == 'en'){ if($en == 'en'){
$language_type = 1; $language_type = 1;
$en_url = $_SERVER['REQUEST_URI'];
$zh_url = substr($_SERVER['REQUEST_URI'],3);
}else{ }else{
$language_type = 0; $language_type = 0;
$en_url = '/en'.$_SERVER['REQUEST_URI'];
$zh_url = $_SERVER['REQUEST_URI'];
} }
$zh = $zh_url;
$en = $en_url;
$about = IndexAbout::query() $about = IndexAbout::query()
->where('language_type',$language_type) ->where('language_type',$language_type)
->orderBy('sequence', 'asc') ->orderBy('sequence', 'asc')
...@@ -34,7 +41,30 @@ class AboutController extends Controller ...@@ -34,7 +41,30 @@ class AboutController extends Controller
->where('language_type',$language_type) ->where('language_type',$language_type)
->orderBy('sort','asc') ->orderBy('sort','asc')
->get(); ->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() public function groupStrategy()
......
...@@ -100,7 +100,7 @@ class IndexController extends Controller ...@@ -100,7 +100,7 @@ class IndexController extends Controller
$v['children'] = $children; $v['children'] = $children;
} }
return view('index.index') return view('Index.index')
->with('banner1',$banner1) ->with('banner1',$banner1)
->with('banner2',$banner2) ->with('banner2',$banner2)
->with('banner3',$banner3) ->with('banner3',$banner3)
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<span class="sr-only">Toggle navigation</span> <span class="sr-only">Toggle navigation</span>
<i class="icon-menu"></i> <i class="icon-menu"></i>
</button> </button>
<a class="language" style="cursor: pointer" href="{{url('index')}}"> <a class="language" style="cursor: pointer" href="{{url('')}}">
<span class="zh">中文</span> <span class="zh">中文</span>
</a> </a>
<a class="language1" style="cursor: pointer;" href="{{url('en/index')}}" > <a class="language1" style="cursor: pointer;" href="{{url('en/index')}}" >
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
<a href="{{url('en/index')}}">Home</a> <a href="{{url('en/index')}}">Home</a>
@else @else
<a href="{{url('index')}}">首页</a> <a href="{{url('')}}">首页</a>
@endif @endif
</li> </li>
@foreach($IndexNav as $topNav) @foreach($IndexNav as $topNav)
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
@if($language_type == 1) @if($language_type == 1)
<a href="{{url('en/index')}}">Home</a> <a href="{{url('en/index')}}">Home</a>
@else @else
<a href="{{url('index')}}">首页</a> <a href="{{url('')}}">首页</a>
@endif @endif
</li> </li>
@foreach($IndexNav as $topNav) @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