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

dep

parent 0a656c82
<?php
/**
* 就业岗位模型
*/
namespace app\common\model;
use think\model\concern\SoftDelete;
class JoinUs extends Model
{
use SoftDelete;
public $softDelete = true;
protected $autoWriteTimestamp = true;
//可搜索字段
protected $searchField = ['title', 'source','type'];
public $language_type = [
0 => '中文',
1 => '英语'
];
}
...@@ -80,7 +80,27 @@ class IndexController extends Controller ...@@ -80,7 +80,27 @@ class IndexController extends Controller
->get(); ->get();
$events = IndexEvents::query()->where('language_type', '=', $language_type)->get(); $events = IndexEvents::query()->where('language_type', '=', $language_type)->get();
$setting = IndexSetting::query()->first(); $setting = IndexSetting::query()->first();
return view('index')
$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.index')
->with('banner1',$banner1) ->with('banner1',$banner1)
->with('banner2',$banner2) ->with('banner2',$banner2)
->with('banner3',$banner3) ->with('banner3',$banner3)
...@@ -88,6 +108,7 @@ class IndexController extends Controller ...@@ -88,6 +108,7 @@ class IndexController extends Controller
->with('audio_url',$audio_url) ->with('audio_url',$audio_url)
->with('article1',$article1) ->with('article1',$article1)
->with('article2',$article2) ->with('article2',$article2)
->with('IndexNav',$navigation)
->with('language_type',$language_type) ->with('language_type',$language_type)
->with(compact('events')) ->with(compact('events'))
->with(compact('banner4')) ->with(compact('banner4'))
......
...@@ -29,7 +29,7 @@ class AppServiceProvider extends ServiceProvider ...@@ -29,7 +29,7 @@ class AppServiceProvider extends ServiceProvider
Schema::defaultStringLength(191); Schema::defaultStringLength(191);
View::composer( View::composer(
['admin.*', 'index.*','layouts.*'], ['admin.*', 'layouts.*'],
'App\Http\Controllers\HelperController@index' 'App\Http\Controllers\HelperController@index'
); );
} }
......
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