|
|
@@ -21,7 +21,8 @@ class JiamengController extends HomeBaseController
|
|
|
isset($param['enname']) or $this->error('需要父分类');
|
|
|
$curarr = Db::name('category')->where('enname',$param['enname'])->find();
|
|
|
if($curarr['parent_id']>0){
|
|
|
- $this->error('不是一级分类');
|
|
|
+ header("Location:".url('/404'));
|
|
|
+ exit;
|
|
|
}
|
|
|
$sonarr = Db::name('category')->where('parent_id',$curarr['id'])->order('list_order')->limit(10)->select();
|
|
|
$this->assign('sonarr',$sonarr);
|
|
|
@@ -237,7 +238,12 @@ class JiamengController extends HomeBaseController
|
|
|
isset($param['id']) or $this->error('需要id');
|
|
|
$info = Db::name('jiameng')
|
|
|
->where('id',$param['id'])
|
|
|
+ ->where('status', 1)
|
|
|
->find();
|
|
|
+ if(empty($info)){
|
|
|
+ header("Location:".url('/404'));
|
|
|
+ exit;
|
|
|
+ }
|
|
|
//内容
|
|
|
$content = Db::name('jiameng_data')->where('id',$param['id'])->find();
|
|
|
$info['content'] = $content['content'];
|
|
|
@@ -258,7 +264,7 @@ class JiamengController extends HomeBaseController
|
|
|
$info['jm_support'] = $jmSupport? $jmSupport : $supports;
|
|
|
$areaList = config('params.areaList');
|
|
|
$areaId = isset($info['area_id']) && $info['area_id']? intval($info['area_id']) : '-1';
|
|
|
- $area = isset($areaList[$areaId])? $areaList[$areaId] : '暂无';
|
|
|
+ $area = isset($areaList[$areaId])? $areaList[$areaId] : '不限';
|
|
|
$info['area'] = $info['area']? $info['area'] : $area;
|
|
|
|
|
|
$catinfo = Db::name('category')->where('id',$info['catid'])->find();
|
|
|
@@ -269,22 +275,23 @@ class JiamengController extends HomeBaseController
|
|
|
//热门行业
|
|
|
$hot_cate = Db::name('category')->where('parent_id',$parinfo['id'])->order('list_order')->limit(12)->select();
|
|
|
//排行
|
|
|
- $paihang = Db::name('jiameng')->field('id,title,logo,touzi_level,mendian,hits')->where('catid',$info['catid'])->order('hits desc')->limit(5)->select();
|
|
|
+ $paihang = Db::name('jiameng')->field('id,title,logo,touzi_level,mendian,hits')->where('catid',$info['catid'])->where('status', 1)->order('hits desc')->limit(5)->select();
|
|
|
//动态
|
|
|
- $about_news = Db::name('news')->field('id,title,thumb,create_time')->where('ncatid',1)->order('id desc')->limit(6)->select();
|
|
|
- $brand_news = Db::name('news')->field('id,title,create_time')->where('catid',$info['catid'])->order('id desc')->limit(6)->select();
|
|
|
+ $about_news = Db::name('news')->field('id,title,thumb,create_time')->where(['ncatid'=>1,'status'=> 1])->order('id desc')->limit(6)->select();
|
|
|
+ $brand_news = Db::name('news')->field('id,title,thumb,create_time')->where(['catid'=>$info['catid'],'status'=> 1])->order('id desc')->limit(6)->select();
|
|
|
//热门加盟
|
|
|
- $hot_jm = Db::name('jiameng')->field('id,title,hits')->where('catid',$info['catid'])->order('hits desc')->limit(20)->select();
|
|
|
+ $hot_jm = Db::name('jiameng')->field('id,title,hits')->where('catid',$info['catid'])->where('status', 1)->order('hits desc')->limit(20)->select();
|
|
|
//最新加盟
|
|
|
$zx_jm = $brand8 = JiamengService::getNewList(20);
|
|
|
//精选加盟
|
|
|
- $jx_jm = Db::name('jiameng')->field('id,title')->where('catid',$info['catid'])->orderRaw('rand()')->limit(20)->select();
|
|
|
+ $jx_jm = Db::name('jiameng')->field('id,title')->where('catid',$info['catid'])->where('status', 1)->orderRaw('rand()')->limit(20)->select();
|
|
|
//seo
|
|
|
$seo_title = str_replace('|',$info['title'],$catinfo['seo_title']);
|
|
|
$seo_keywords = str_replace('|',$info['title'],$catinfo['seo_keywords']);
|
|
|
- $seo_desc = mb_substr($info['content'],0,200,'utf8');
|
|
|
- $seo_desc = strip_tags($seo_desc);
|
|
|
+ $seo_desc = trim(strip_tags($info['content']));
|
|
|
+ $seo_desc = mb_substr($seo_desc,0,200,'utf8');
|
|
|
$link_cate_name = $parinfo['enname'];
|
|
|
+ //var_dump($seo_desc.'++');
|
|
|
// $this->assign('link_cate_name',$link_cate_name);
|
|
|
$this->assign('seo_title',$seo_title);
|
|
|
$this->assign('seo_keywords',$seo_keywords);
|
|
|
@@ -305,6 +312,7 @@ class JiamengController extends HomeBaseController
|
|
|
|
|
|
public function message(){
|
|
|
$param = $this->request->param();
|
|
|
+ $orignUrl = $this->request->header('origin');
|
|
|
// isset($param['name'])&&$param['name']!='' or $this->error('请填写姓名');
|
|
|
isset($param['mobile'])&&$param['mobile']!='' or $this->error('请填写手机号');
|
|
|
$param['create_time'] = time();
|
|
|
@@ -313,10 +321,12 @@ class JiamengController extends HomeBaseController
|
|
|
$todaytime = strtotime(date('Y-m-d'));
|
|
|
if(strlen($param['content'])>300){
|
|
|
$this->error('字符长度不超过300个');
|
|
|
+ exit;
|
|
|
}
|
|
|
|
|
|
if(isset($param['tzed']) && $param['tzed']<=0){
|
|
|
$this->error('请选择投资额度');
|
|
|
+ exit;
|
|
|
}
|
|
|
$param['content'] = strFilter($param['content']);
|
|
|
$param['name'] = strFilter($param['name']);
|
|
|
@@ -325,6 +335,7 @@ class JiamengController extends HomeBaseController
|
|
|
$param['area'] = strFilter($param['area']);
|
|
|
$param['wechat'] = strFilter($param['wechat']);
|
|
|
$param['type'] = 1;
|
|
|
+ $param['source_url'] = $orignUrl;
|
|
|
|
|
|
// print_r($param);exit;
|
|
|
//判断是否已超过10次 今天这个ip是否留言过
|