Commit 19367467 authored by liukang's avatar liukang

修改提交

parent 5e72bafe
......@@ -25,14 +25,26 @@ class About extends Base
return view("/home/about/contact");
}
public function us(){
$id = input('article');
$agreement = new mabout();
$agreement = $agreement->get_us();
$list = $agreement->where('isdeleted',0)->order('order','desc')->select();
$list = $this->dealData($list);
$content = array();
if ($id){
$content = $agreement->where('id',$id)->where('isdeleted',0)->order('current','desc')->find();
}else{
if (!empty($list)){
$id = $list[0]['id'];
$content = $agreement->where('id',$id)->where('isdeleted',0)->order('current','desc')->find();
}
}
$this->assign('url',$this->url);
if(!$agreement){
if(!$content){
return view("/home/public/error");
}
$this->assign('us',$agreement);
$this->assign('list',$list);
$this->assign('us',$content);
$this->assign('id',$id);
return view("/home/about/aboutus");
}
public function agreement(){
......
......@@ -13,8 +13,8 @@ class App extends Model
{
return $this->hasOne('app\admin\model\Users','id','user_id');
}
public function img()
{
return $this->hasOne('app\common\model\Img','id','img_id');
}
// public function img()
// {
// return $this->hasOne('app\common\model\Img','id','img_id');
// }
}
\ No newline at end of file
......@@ -19,21 +19,105 @@ class Base extends Error
public function initialize(){
$this->url = request()->controller();
$this->host_name = request()->domain();
$other_logo = HomeConfig::where("home_config_cate_id",3)->where("isdeleted",0)->Order("current","desc")->find();
$index_logo = HomeConfig::where("home_config_cate_id",2)->where("isdeleted",0)->Order("current","desc")->find();
$other_logo = $this->getImage(4);
$index_logo = $this->getImage(5);
$vedio = HomeConfig::where("home_config_cate_id",1)->where("isdeleted",0)->Order("current","desc")->find();
if(!empty($index_logo)){
$this->logo_url = $index_logo->img->img_url.$index_logo->img->img_name;
}
if(!empty($other_logo)){
$this->other_logo_url = $other_logo->img->img_url.$other_logo->img->img_name;
}
if(!empty($vedio)){
$this->vedio_url = $vedio->img->img_url.$vedio->img->img_name;
}
$this->assign("other_logo_url",$this->other_logo_url);
$this->assign("logo_url",$this->logo_url);
$this->getNav();
$this->assign("other_logo_url",$other_logo);
$this->assign("logo_url",$index_logo);
$this->assign("vedio_url",$this->vedio_url);
$this->assign("host_name",$this->host_name);
}
public function getImage($type){
//获取首页背景图
$bannerImgId = db('advertisement')->where(array('type'=>$type,'is_display'=>1))->field('id,mintype,packs')->select();
$bannerImgId = $this->dealData($bannerImgId);
$data = [];
foreach ($bannerImgId as $k=>$v){
$data = $this->getList($v);
}
return $data;
}
public function getList($data){
$where[] = ['starttime','<',time()];
$where[] = ['endtime','>',time()];
$where[] = ['starthour','<',date('h',time())];
$where[] = ['endhour','>',date('h',time())];
$cont = db('advertisement_cont')
->where($where)
->where(array('advert_id'=>$data['id']))
->field('picSrc,packs')
->order('orderby desc')
->select();
$cont = $this->dealData($cont);
$imagePre = "https://oss.3yakj.com/application_static_data";
$bannerImg = [];
if ($data['mintype'] == 0){
if (!empty($cont)){
$bannerImg = $imagePre.$cont[0]['picSrc'];
}else{
$bannerImg = '';
}
}else{
foreach ($cont as $value){
$bannerImg[] = $imagePre.$value['picSrc'];
}
}
return $bannerImg;
}
public function getNav(){
$nav = db('menu')->where(array('status'=>1))->field('id,title,url,show_type,packs')->order('order desc')->select();
$nav = $this->dealData($nav);
foreach ($nav as $key=>$value){
if (!empty($value['url'])){
$class = explode('.html',$value['url'])[0];
if ($class !== '/'){
$nav[$key]['class'] = explode('/',$class)[1];
if ($nav[$key]['class'] == 'index'){
$nav[$key]['class'] = 'home';
}
}else{
$nav[$key]['class'] = 'home';
}
}else{
$nav[$key]['class'] = '';
}
$child = db('menu_child')->where(array('pid'=>$value['id'],'status'=>1))->field('title,show_type,url,packs')->order('order desc')->select();
$nav[$key]['child'] = $this->dealData($child);
}
$this->assign('nav',$nav);
}
/**
* 处理域名数据
* @param $data
* @param $type 0:一维数组,1 二维数据
* @return array
*/
public function dealData($data,$type = 1){
$web_type = config('app.web_type');
$return = [];
if ($type){
foreach ($data as $value){
if (!empty($value['packs'])){
if (in_array($web_type,json_decode($value['packs'],true))){
$return[] = $value;
}
}
}
}else{
if (!empty($data['packs'])){
if (in_array($web_type,json_decode($data['packs'],true))){
$return = $data;
}
}
}
return $return;
}
}
\ No newline at end of file
......@@ -15,6 +15,7 @@ class Game extends Base
public function list(){
$game_cate_list = GameCate::where("isdeleted",0)->select();
$game_cate_list = $this->dealData($game_cate_list);
$map = array();
$params = request()->param();
$this->assign("params",$params);
......@@ -34,6 +35,7 @@ class Game extends Base
}
}
$game_list = mGame::where($map)->select();
$game_list = $this->dealData($game_list);
$this->assign("game_cate_list",$game_cate_list);
$this->assign("game_cate_id",$game_cate_id);
$this->assign("game_list",$game_list);
......
......@@ -12,10 +12,14 @@ class Index extends Base
{
public function index()
{
$app_list = App::where("isdeleted",0)->order('num','asc')->select();
$app_list = App::where("isdeleted",0)->order('num','desc')->select();
$app_list = $this->dealData($app_list);
$help_list = Question::where("isdeleted",0)->order("current","desc")->paginate(4);
$help_list = $this->dealData($help_list);
$news_list = News::where("isdeleted",0)->order("current","desc")->paginate(4);
$news_list = $this->dealData($news_list);
$know_list = $this->getImage(6);
$this->assign('know_list',$know_list);
$this->assign('app_list',$app_list);
$this->assign('help_list',$help_list);
$this->assign('news_list',$news_list);
......@@ -26,8 +30,11 @@ class Index extends Base
public function mobile()
{
$app_list = App::where("isdeleted",0)->order('num','asc')->select();
$app_list = $this->dealData($app_list);
$help_list = Question::where("isdeleted",0)->order("current","desc")->paginate(4);
$help_list = $this->dealData($help_list);
$news_list = News::where("isdeleted",0)->order("current","desc")->paginate(4);
$news_list = $this->dealData($news_list);
$this->assign('app_list',$app_list);
$this->assign('help_list',$help_list);
......@@ -73,8 +80,19 @@ class Index extends Base
public function huatai(Request $request)
{
$imageList = $this->getImage(3);
$this->assign('domain',$request->domain());
$this->assign('url',$this->url);
$this->assign('imageList',$imageList);
return view("/home/index/huatai");
}
public function getConfig(){
$type = input('type');
//获取首页背景图
$bannerImg = $this->getImage($type);
//获取按钮
$button=array();
return json(['banner'=>$bannerImg,'button'=>$button] );
}
}
......@@ -17,7 +17,9 @@ class Join extends Base
$join_cate = new JoinCate();
$join = new mjoin();
$join_list = $join->where('isdeleted',0)->order('join_cate_id','asc')->order('current','desc')->select();
$join_list = $this->dealData($join_list);
$join_cate_list = $join_cate->where('isdeleted',0)->order('id','asc')->select();
$join_cate_list = $this->dealData($join_cate_list);
$this->assign('url',$this->url);
$this->assign('join_cate_list',$join_cate_list);
$this->assign('join_list',$join_list);
......
......@@ -14,7 +14,8 @@ class News extends Base
public function list(){
$pageSize = 5;
$news_list = m_news::where('isdeleted',0)->order('current','desc')->paginate($pageSize);
$web_type = config('app.web_type');
$news_list = m_news::where('isdeleted',0)->where('packs','like',"%{$web_type}%")->order('current','desc')->paginate($pageSize);
$pattern = '/\[\d+\]/';
$matches = array();
......
......@@ -27,27 +27,23 @@ class ServiceHelp extends Base
}
public function service(){
$question_cate_list =QuestionCate::where('isdeleted',0)->select();
for($n=0;$n<count($question_cate_list);$n++){
$img = Img::get(intval($question_cate_list[$n]['img_id']));
$question_cate_list[$n]['img_url'] = $img['img_url'].$img['img_name'];
}
$this->assign('url',$this->url);
$this->assign('question_cate_list',$question_cate_list);
return view("/home/servicehelp/service");
}
public function help(){
$question_cate_list =QuestionCate::where('isdeleted',0)->select();
for($n=0;$n<count($question_cate_list);$n++){
$img = Img::get(intval($question_cate_list[$n]['img_id']));
$question_cate_list[$n]['img_url'] = $img['img_url'].$img['img_name'];
}
// $question_cate_list = $this->dealData($question_cate_list);
$question_list = array();
$cate = new QuestionCate();
if(count($question_cate_list)>0){
$web_type = config('app.web_type');
$cate = QuestionCate::where('isdeleted',0)->where('id',$question_cate_list[0]['id'])->find();
$question_list = Question::where('isdeleted',0)->where('question_cate_id',$question_cate_list[0]['id'])->order('current','desc')->paginate(10, false, [
$question_list = Question::where('isdeleted',0)
->where('question_cate_id',$question_cate_list[0]['id'])
->where('packs','like',"%{$web_type}%")
->order('current','desc')
->paginate(10, false, [
'query' => request()->param()
]);
$pattern = '/\[\d+\]/';
......@@ -89,7 +85,7 @@ class ServiceHelp extends Base
$cate = QuestionCate::where('isdeleted',0)->where('id',$cate_id)->find();
if(empty($cate)){
// return view("/home/public/error");
return view("/home/public/error");
}
$question_list = Question::where('isdeleted',0)->where('question_cate_id',$cate_id)->order('current','desc')->paginate(10, false, [
'query' => request()->param()
......@@ -120,11 +116,6 @@ class ServiceHelp extends Base
$this->redirect('/servicehelp/help.html');
}
$question_cate_list =QuestionCate::where('isdeleted',0)->select();
for($n=0;$n<count($question_cate_list);$n++){
$img = Img::get(intval($question_cate_list[$n]['img_id']));
$question_cate_list[$n]['img_url'] = $img['img_url'].$img['img_name'];
}
$question = Question::where('isdeleted',0)->where('id',$question_id)->find();
$this->assign('url',$this->url);
if(empty($question)){
......@@ -152,12 +143,12 @@ class ServiceHelp extends Base
public function search(){
$key_str = input('s_key','');
$question_cate_list =QuestionCate::where('isdeleted',0)->select();
for($n=0;$n<count($question_cate_list);$n++){
$img = Img::get(intval($question_cate_list[$n]['img_id']));
$question_cate_list[$n]['img_url'] = $img['img_url'].$img['img_name'];
}
$question_list = Question::where('isdeleted',0)->whereLike('title',"%".$key_str."%")->order('current','desc')->paginate(10, false, [
$web_type = config('app.web_type');
$question_list = Question::where('isdeleted',0)
->whereLike('title',"%".$key_str."%")
->whereLike('packs',"%".$web_type."%")
->order('current','desc')
->paginate(10, false, [
'query' => request()->param()
]);
$pattern = '/\[\d+\]/';
......
......@@ -142,5 +142,9 @@ return [
'show_error_msg' => false,
// 异常处理handle类 留空使用 \think\exception\Handle
'exception_handle' => '',
//----------------------------------------------------------------------
// 自定义参数
//----------------------------------------------------------------------
'web_type' => 1,
];
......@@ -16,7 +16,7 @@ return [
'hostname' => '106.55.103.148:3398',
// 数据库名
// 'database' => 'fanjiao_web_new',
'database' => 'fanchi_web_new',
'database' => 'fanjiao_web_new',
// 'database' => '3yakj_web_new',
// 用户名
'username' => 'root',
......
......@@ -19,7 +19,7 @@ Route::get('home/', 'index/Index/index');
Route::get('', 'index/Index/index');
Route::get('mobile', 'index/Index/mobile');
Route::any('uploads_file', 'admin/Uploads/uploads');
Route::post('getConfig', 'admin/Uploads/getConfig');
Route::post('getConfig', 'index/Index/getConfig');
Route::get('hello/:name', 'index/hello');
......
This diff is collapsed.
......@@ -125,14 +125,16 @@
<p class="line"></p>
<nav>
<ul class="clearfix">
<li class=" on "><a href="/aboutus/us.html" "="">关于我们</a></li>
<li class=""><a href="/aboutus/agreement.html" "="">用户协议</a></li>
<!-- <li class=""><a href="/aboutus/vipterms.html" "="">会员条款</a></li>-->
{volist name="list" id="vo"}
<li class="{if $id==$vo.id}on{/if}"><a href="/aboutus/us/article/{$vo.id}.html">{$vo.title}</a></li>
{/volist}
</ul>
</nav>
{if !empty($us)}
<section class="info-sec info-sec-1">
{:htmlspecialchars_decode($us.content)}
</section>
{/if}
......
......@@ -65,7 +65,7 @@
</nav>
<section>
{volist name="game_list" id="vo" key="k"}
<p><a href="{$vo.file_link}" target="_blank"><img src="{$vo.img.img_url}{$vo.img.img_name}" alt="{$vo.game_cate.title}" width="960" height="260" class="alignnone size-full wp-image-4485"></a></p>
<p><img src="{$vo.img_url}" style="margin-top: 10px;" alt="{$vo.game_cate.title}" width="960" height="260" class="alignnone size-full wp-image-4485"></p>
{/volist}
</section>
</div>
......
......@@ -265,16 +265,17 @@
<!-- </div>-->
</div>
</header>
<!-- <section class="sec-1">-->
<!-- <h2 class="tit">用视频认识我</h2>-->
<!-- <p class="note">三丫互娱 | 新秀娱乐</p>-->
<!-- <ul class="clearfix">-->
<!-- <li><img class="te" src="/static/common/img/1290.png"></li>-->
<!-- <li><img class="te" src="/static/common/img/2290.png"></li>-->
<!-- <li><img class="te" src="/static/common/img/3290.png"></li>-->
<!-- <li><img class="te" src="/static/common/img/4290.png"></li>-->
<!-- </ul>-->
<!-- </section>-->
{if !empty($know_list)}
<section class="sec-1">
<h2 class="tit">用视频认识我</h2>
<p class="note">进入凡骄的世界,去结识那些陌生而有趣的人</p>
<ul class="clearfix">
{volist name="know_list" id="vo"}
<li><img class="te" src="{$vo.img_url}" style="width:290px"></li>
{/volist}
</ul>
</section>
{/if}
<!-- <section class="sec-2">
<h2 class="tit">年轻人的社交选择</h2>
<p class="note">三丫互娱 | 朱贝娱乐<br></p>
......@@ -317,26 +318,28 @@
</ul>
</div>
</section>-->
<!-- <section id="downloads" name="downloads" class="sec-3">-->
<!-- <h2 class="tit">根据你的手机,选择下载</h2>-->
<!-- <ul class="clearfix">-->
<!-- -->
<!-- {volist name="app_list" id="vo"}-->
<!-- <li class="down">-->
<!-- {if ( $vo.app_cate.title!='QC')}-->
<!-- <a style="text-align: center;" href="{$vo.file_link}" target="_Blank" class="ciqclickbtn" _client="PC" _page="首页" _position="底部" _name="{$vo.app_cate.title}下载">-->
<!-- <img class="te" alt="" style="width:100px;height:100px;text-align: center!important;" src="{$vo.img.img_url}{$vo.img.img_name}">-->
<!-- <p style="margin-top: 20px">{$vo.app_cate.title}</p>-->
<!-- </a>-->
<!-- {else /}-->
<!-- <img alt="" style="width:100%;height:100%" src="{$vo.img.img_url}{$vo.img.img_name}">-->
<!-- {/if}-->
<!-- </li>-->
<!-- {/volist}-->
<!-- </ul>-->
<!-- </section>-->
<section id="downloads" name="downloads" class="sec-3">
{empty name="app_list"}{else}
<h2 class="tit">根据你的手机,选择下载</h2>
<ul class="clearfix">
{volist name="app_list" id="vo"}
<li class="down" style="margin-top: 10px;">
{if ( $vo.app_cate.title!='QC')}
<a style="text-align: center;" href="{$vo.file_link}" target="_Blank" class="ciqclickbtn" _client="PC" _page="首页" _position="底部" _name="{$vo.app_cate.title}下载">
<img class="te" alt="" style="width:100px;height:100px;text-align: center!important;" src="{$vo.img_url}">
<p style="margin-top: 20px">{$vo.app_cate.title}</p>
</a>
{else /}
<img alt="" style="width:100%;height:100%" src="{$vo.img_url}">
{/if}
</li>
{/volist}
</ul>
{/empty}
</section>
<section class="sec-4">
<ul class="clearfix" style="display: flex; justify-content: space-around">
<li>
......
......@@ -104,7 +104,7 @@
</div>
<div class="swiper-pagination swiper-pagination-clickable"><span class="swiper-pagination-bullet swiper-pagination-bullet-active"></span></div>
</section>
{if !empty(join_cate_list)}
<section class="section2">
<p>在这里,你将拥有宽松、愉悦、平等的工作环境,亦可收获友爱、尊重、温暖的伙伴</p>
<p>更重要的是,你的个人价值将被最大化实现,你的努力将被所有人看见。</p>
......@@ -161,7 +161,7 @@
{/volist}
<!--end of foreach-->
</section>
{/if}
</div>
......
......@@ -26,86 +26,37 @@
<header class="common-header" style="background: none">
<!-- <a class="logo-href" href="/"></a>-->
<ul class="clearfix">
<li class="no-border">
<a class="home" href="{:url('/home')}">首页</a>
</li>
<!--<li>
<a class="news {$url=='News'?'active':''}" href="/nationalTide">国潮</a>
</li>-->
<!-- <li>-->
<!-- <a class="news {$url=='News'?'active':''}" href="{:url('/news')}">动态</a>-->
<!-- </li>-->
<li>
<a class="join {$url=='Join'?'active':''}" href="{:url('/join')}">加入我们</a>
</li>
{volist name="nav" id="vo" key="k"}
{if !empty($vo.child)}
<li class="white-bg-service">
<span class="service business aboutuson">关于我们
<span class="down-list">
<span class="item colortext">
<a href="javascript:">关于我们&nbsp;&nbsp;</a>
</span>
<span class="item">
<a href="{:url('/aboutus')}">关于我们</a>
<span class="service">&nbsp;{$vo.title}&nbsp;
<span class="down-list" style="position: relative;top: -30px;left: 0px;">
<span class="item colortext" style="left: -1px;width: 100%">
<a href="javascript:">{$vo.title}</a>
</span>
{volist name="vo.child" id="child" key="key"}
<span class="item">
<a href="{:url('/contact')}">联系我们</a>
</span>
</span>
</span>
</li>
<li class="white-bg-service">
<span class="service helpon">服务与帮助
<span class="down-list">
<span class="item colortext">
<a href="{:url('/servicehelp/help')}">服务与帮助</a>
</span>
<span class="item">
<a href="{:url('/servicehelp/help')}">帮助中心</a>
<a href="{$child.url}" {if $child.show_type==1}target="_blank"{/if}>{$child.title}</a>
</span>
{/volist}
</span>
</span>
<li>
{else \}
<li {if $k==1}class="no-border"{else}class="white-bg-service"{/if}>
<a class="{$vo.class} {$url==ucfirst($vo.class)?'active':''}" href="{$vo.url}" {if $vo.show_type==1}target="_blank"{/if}>{$vo.title}</a>
</li>
<!-- <li class="white-bg-service">-->
<!-- <span class="service helpon">朱贝直播助手-->
<!-- <span class="down-list"> -->
<!-- <span class="item colortext">-->
<!-- <a href="">朱贝直播助手</a>-->
<!-- </span> -->
<!-- <span class="item">-->
<!-- <a href="http://oss.3yakj.com/app/zhuBeiLive3.0.rar">for Windows</a>-->
<!-- </span> -->
<!-- <span class="item">-->
<!-- <a target="_blank" href="https://obsproject.com">OBS下载地址</a>-->
<!-- </span>-->
<!-- &lt;!&ndash;<span class="item">&ndash;&gt;-->
<!-- &lt;!&ndash;<a href="https://cdn-fastly.obsproject.com/downloads/obs-mac-27.1.dmg">for mac</a>&ndash;&gt;-->
<!-- &lt;!&ndash;</span>&ndash;&gt;-->
<!-- <span class="item">-->
<!-- <a target="_blank" href="https://lcnsc3uqhj.feishu.cn/docs/doccnJ8LBZipIQUarP0Sous9ouc">帮助中心</a>-->
<!-- </span>-->
<!-- </span>-->
<!-- </span>-->
<!-- </li>-->
<!-- <li class="white-bg-service">-->
<!-- <a class="home" href="http://guild-rds.3yakj.com" target="_blank">公会入口</a>-->
<!-- &lt;!&ndash;<span class="service business guildon">工会入口-->
<!-- <span class="down-list">-->
<!-- <span class="item colortext">-->
<!-- <a href="javascript:">工会入口&nbsp;&nbsp;</a>-->
<!-- </span>-->
<!-- <span class="item">-->
<!-- <a href="http://guild-rds.3yakj.com" target="_blank">mcn机构入口</a>-->
<!-- </span>-->
<!-- <span class="item">-->
<!-- <a href="http://guild-rds.3yakj.com" target="_blank">公会入口</a>-->
<!-- </span>-->
<!-- </span>-->
<!-- </span>&ndash;&gt;-->
<!-- </li>-->
<!-- <li class="white-bg-service">-->
<!-- <a class="home" href="{:url('/index/index/huatai')}">华泰证券</a>-->
<!-- </li>-->
{/if}
{/volist}
</ul>
</header>
<script>
//由于未知bug导致child不为空的时候会生成一个空的li,这里删除
var ul = document.getElementsByClassName("clearfix");
var childList = ul[0].children;
for (var i = 0;i < childList.length ; i++){
if (childList[i].className === ''){
ul[0].removeChild(ul[0].children[i]);
}
}
</script>
\ No newline at end of file
......@@ -186,6 +186,7 @@
</div>
{/volist}
</div>
{if !empty($question_cate_list)}
<div class="usercontext">
<div class="tips-container">
<form id="search-form" method="get" action="/servicehelp/search.html">
......@@ -226,6 +227,7 @@
{/if}
</div>
</div>
{/if}
</section>
</div>
......
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