// +---------------------------------------------------------------------- namespace app\home\controller; use think\Db; use think\Validate; class News extends Base { private $parent='信息公开'; /** * 艺术资产托管申请 */ public function subscription(){ $params=request()->param(); $query=$this->_checksub($params); if($query)$this->success('提交成功'); else $this->error('提交失败'); } /** * 详细页 * @return string */ public function content(){ $n_id=input('n_id','','intval'); $n_kind=input('n_kind','','intval'); $subid=input('s_id','','intval'); $submenus=[]; $submenus[22]=['title'=>'公告','table'=>'bsgg','parent'=>$this->parent,'menuid'=>2,'n_id'=>'','n_kind'=>'']; $submenus[23]=['title'=>'要闻','table'=>'bsyw','parent'=>$this->parent,'menuid'=>2,'n_id'=>'','n_kind'=>'']; $submenus[25]=['title'=>'政策','table'=>'bszc','parent'=>$this->parent,'menuid'=>2,'n_id'=>'','n_kind'=>'']; $submenus[303]=['title'=>'活动','table'=>'bszc','parent'=>$this->parent,'menuid'=>2,'n_id'=>'','n_kind'=>'']; $submenus[44]=['title'=>'政策','table'=>'news','parent'=>'关于本所','menuid'=>1,'n_id'=>'','n_kind'=>3]; $submenus[41]=['title'=>'人才招聘','table'=>'news','parent'=>'关于本所','menuid'=>1,'n_id'=>'','n_kind'=>5]; $submenus[52]=['title'=>'文化金融服务中心','table'=>'news','parent'=>'合作机构','menuid'=>4,'n_id'=>'','n_kind'=>6]; $submenus[71]=['title'=>'掌柜文化金服-公馆','table'=>'zgwhjf_ggnew','parent'=>'合作机构','menuid'=>4,'n_id'=>'','n_kind'=>'']; $submenus[72]=['title'=>'掌柜文化金服-艺拍','table'=>'zgwhjf_ypnew','parent'=>'合作机构','menuid'=>4,'n_id'=>$n_id,'n_kind'=>'']; $submenus[73]=['title'=>'掌柜文化金服-商城','table'=>'zgwhjf_scnew','parent'=>'合作机构','menuid'=>4,'n_id'=>$n_id,'n_kind'=>'']; $submenus[74]=['title'=>'掌柜文化金服-艺术家银行','table'=>'zgwhjf_ysjyhnew','parent'=>'合作机构','menuid'=>4,'n_id'=>$n_id,'n_kind'=>'']; $submenus[53]=['title'=>'专板(专区)','table'=>'news','parent'=>'合作机构','menuid'=>4,'n_id'=>$n_id,'n_kind'=>7]; $submenus[54]=['title'=>'专板线上托管中心','table'=>'news','parent'=>'合作机构','menuid'=>4,'n_id'=>$n_id,'n_kind'=>8]; $submenus[55]=['title'=>'省(市)运营中心','table'=>'news','parent'=>'合作机构','menuid'=>4,'n_id'=>$n_id,'n_kind'=>9]; $submenus[56]=['title'=>'推荐机构','table'=>'news','parent'=>'合作机构','menuid'=>4,'n_id'=>$n_id,'n_kind'=>10]; $submenus[57]=['title'=>'驻场服务机构','table'=>'news','parent'=>'合作机构','menuid'=>4,'n_id'=>$n_id,'n_kind'=>11]; $submenus[58]=['title'=>'第三方服务机构','table'=>'news','parent'=>'合作机构','menuid'=>4,'n_id'=>$n_id,'n_kind'=>12]; $submenus[59]=['title'=>'文产商城合作商','table'=>'news','parent'=>'合作机构','menuid'=>4,'n_id'=>$n_id,'n_kind'=>13]; $submenus[40]=['title'=>'文化四板活动','table'=>'bshd','parent'=>'文化四板','menuid'=>3,'n_id'=>$n_id,'n_kind'=>'']; $submenus[26]=['title'=>'政策法规','table'=>'zcfg','parent'=>'国有资产','menuid'=>5,'n_id'=>$n_id,'n_kind'=>'']; $submenus[24]=['title'=>'活动','table'=>'sczcxy','parent'=>'信息公开','menuid'=>2,'n_id'=>$n_id,'n_kind'=>'']; $submenus[275]=['title'=>'挂牌展示专区','table'=>'news','parent'=>'文化金融中心','menuid'=>275,'n_id'=>$n_id,'n_kind'=>16]; $submenus[344]=['title'=>'博士后招聘启事','table'=>'bszc','parent'=>'博士后科研工作站','menuid'=>326,'n_id'=>$n_id,'n_kind'=>'']; $submenus[333]=['title'=>'交易规则','table'=>'bszc','parent'=>'国有业务','menuid'=>332,'n_id'=>$n_id,'n_kind'=>'']; $submenus[334]=['title'=>'交易流程图','table'=>'bszc','parent'=>'国有业务','menuid'=>332,'n_id'=>$n_id,'n_kind'=>'']; $submenus[335]=['title'=>'交易政策','table'=>'bszc','parent'=>'国有业务','menuid'=>332,'n_id'=>$n_id,'n_kind'=>'']; $submenus[353]=['title'=>'通知公告','table'=>'bszc','parent'=>'国有业务','menuid'=>332,'n_id'=>$n_id,'n_kind'=>'']; $menuid=''; $parent=''; $table='news'; $title=''; if(isset($submenus[$subid])&&$submenus[$subid]){ $current=$submenus[$subid]; $menuid=$current['menuid']; $parent=$current['parent']; $table=$current['table']; $title=$current['title']; $n_kind=$current['n_kind']; $this->assign('current_sub_menu_id',$subid); }else if($n_kind){ $kinds=array_column($submenus,'n_kind'); $keys=array_keys($submenus); if(count($keys)&&count($kinds)){ $search=array_combine($kinds,$keys); if(isset($search[$n_kind])&&$search[$n_kind]){ $subid=intval($search[$n_kind]); $current=$submenus[$subid]; $menuid=$current['menuid']; $parent=$current['parent']; $table=$current['table']; $title=$current['title']; $n_kind=$current['n_kind']; $this->assign('current_sub_menu_id',$subid); } } } $this->assign('s_id',$subid); $tpl=":newscontent"; if($table!="news")$tpl=":news"; $url=SITE_PATH.url('news/content',['n_id'=>$n_id,'n_kind'=>$n_kind,'s_id'=>$subid]); return $this->news($menuid,$parent,$title,$table,$n_id,$n_kind,$tpl,$subid,$url); } //详情页 public function bshd() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',40); $url=SITE_PATH.url('news/bshd',['n_id'=>$n_id]); return $this->news(3,'文化四板','文化四板活动','bshd',$n_id,'',':news','',$url); } public function zcfg() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',26); $url=SITE_PATH.url('news/zcfg',['n_id'=>$n_id]); return $this->news(5,'国有资产','政策法规','zcfg',$n_id,'',':news','',$url); } public function gyxm() { $c_id=input('c_id',0,'intval'); $url=SITE_PATH.url('news/gyxm',['n_id'=>$c_id]); return $this->cult_infotow(3,'','国有项目','gyxm',$c_id); } public function whzc() { $c_id=input('c_id',0,'intval'); $url=SITE_PATH.url('news/whzc',['c_id'=>$c_id]); return $this->cult_info(5,'whzc','文化资产','otinfo',$c_id,$url); } public function fwhzc() { $c_id=input('c_id',0,'intval'); $url=SITE_PATH.url('news/fwhzc',['c_id'=>$c_id]); return $this->cult_info(5,'fwhzc','非文化资产','otinfo',$c_id,$url); } //挂牌信息 public function gpxx() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',65); $url=SITE_PATH.url('news/gpxx',['c_id'=>$c_id]); return $this->sczcxy_new(2,$this->parent,'挂牌信息','sczcxy',$n_id,1,'gpxx',$url); } //融资快讯 public function rzkx() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',66); $url=SITE_PATH.url('news/rzkx',['n_id'=>$n_id]); return $this->sczcxy_new(2,$this->parent,'活动','sczcxy',$n_id,2,'rzkx',$url); } //挂牌企业资讯 public function gpqyzx() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',67); $url=SITE_PATH.url('news/gpqyzx',['c_id'=>$c_id]); return $this->sczcxy_new(2,$this->parent,'挂牌企业资讯','sczcxy',$n_id,3,'gpqyzx',$url); } //政策行研 public function zcxy() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',68); $url=SITE_PATH.url('news/zcxy',['c_id'=>$c_id]); return $this->sczcxy_new(2,$this->parent,'政策行研','sczcxy',$n_id,4,'zcxy',$url); } public function zgwhjf_ypnew() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',72); $url=SITE_PATH.url('news/zgwhjf_ypnew',['n_id'=>$n_id]); return $this->news(4,'合作机构','掌柜文化金服-艺拍','zgwhjf_ypnew',$n_id,'',':news','',$url); } public function zgwhjf_scnew() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',73); $url=SITE_PATH.url('news/zgwhjf_scnew',['n_id'=>$n_id]); return $this->news(4,'合作机构','掌柜文化金服-商城','zgwhjf_scnew',$n_id,'',':news','',$url); } public function zgwhjf_ysjyhnew() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',74); $url=SITE_PATH.url('news/zgwhjf_ysjyhnew',['n_id'=>$n_id]); return $this->news(4,'合作机构','掌柜文化金服-艺术家银行','zgwhjf_ysjyhnew',$n_id,'',':news','',$url); } public function zbzq() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',53); $url=SITE_PATH.url('news/zbzq',['n_id'=>$n_id]); return $this->news(4,'合作机构','专板(专区)','news',$n_id,7,'',':news','',$url); } public function zbxstgzx() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',54); $url=SITE_PATH.url('news/zbxstgzx',['n_id'=>$n_id]); return $this->news(4,'合作机构','专板线上托管中心','zbxstgzx',$n_id,'',':news','',$url); } public function ssyyzx() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',55); $url=SITE_PATH.url('news/ssyyzx',['n_id'=>$n_id]); return $this->news(4,'合作机构','省(市)运营中心','news',$n_id,9,':news','',$url); } public function tjjg() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',56); $url=SITE_PATH.url('news/tjjg',['n_id'=>$n_id]); return $this->news(4,'合作机构','推荐机构','news',$n_id,10,':news','',$url); } public function zcfwjg() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',57); $url=SITE_PATH.url('news/zcfwjg',['n_id'=>$n_id]); return $this->news(4,'合作机构','驻场服务机构','news',$n_id,11,':news','',$url); } public function dsffwjg() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',58); $url=SITE_PATH.url('news/dsffwjg',['n_id'=>$n_id]); return $this->news(4,'合作机构','第三方服务机构','news',$n_id,12,':news','',$url); } public function bjjg() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',59); $url=SITE_PATH.url('news/bjjg',['n_id'=>$n_id]); return $this->news(1,'合作机构','保荐机构','bjjg',$n_id,'',':news','',$url); } public function bsgg() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',22); $url=SITE_PATH.url('news/bsgg',['n_id'=>$n_id]); return $this->news(2,$this->parent,'公告','bsgg',$n_id,'',':news','',$url); } public function bsyw() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',23); $url=SITE_PATH.url('news/bsyw',['n_id'=>$n_id]); return $this->news(2,$this->parent,'新闻','bsyw',$n_id,'',':news','',$url); } public function bszc() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',25); $url=SITE_PATH.url('news/bszc',['n_id'=>$n_id]); return $this->news(2,$this->parent,'政策','bszc',$n_id,'',':news','',$url); } public function bszc2() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',44); $url=SITE_PATH.url('news/bszc2',['n_id'=>$n_id]); return $this->news(1,'信息公开','政策','news',$n_id,2,':news','',$url); } public function rczp() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',41); $url=SITE_PATH.url('news/rczp',['n_id'=>$n_id]); return $this->news(1,'信息公开','人才招聘','news',$n_id,5,':news','',$url); } public function whjrfwzx() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',52); $url=SITE_PATH.url('news/whjrfwzx',['n_id'=>$n_id]); return $this->news(4,'合作机构','文产商城合作商','news',$n_id,13,':news','',$url); } public function zgwhjf_ggnew() { $n_id=input('n_id',0,'intval'); $this->assign('current_sub_menu_id',71); $url=SITE_PATH.url('news/zgwhjf_ggnew',['n_id'=>$n_id]); return $this->news(4,'合作机构','掌柜文化金服-公馆','zgwhjf_ggnew',$n_id,'',':news','',$url); } public function team() { //专家列表 $lists=Db::name('zjtd')->where(['n_status'=>1])->order('n_order,n_time desc')->select(); shuffle($lists); $cntNum = count($lists); $this->assign("lists",$lists); $this->assign("cntNum",$cntNum); $n_id=input('n_id',0,'intval'); if($n_id==0){ if(!empty($lists)){ $n_id=$lists[0]['n_id']; } } $this->assign('current_sub_menu_id',7); $list=Db::name('zjtd')->where(['n_status'=>1,'n_id'=>$n_id])->find(); $this->assign('list',$list); return $this->view->fetch(":team"); } public function cult() { $c_id=input('c_id',0,'intval'); return $this->cult_info(3,'','文化四板','cult4info',$c_id); } protected function replaceTitle($title=""){ $keys=["唐","唐代","宋","北宋","南宋","宋-元","元","元代","金","金代","清","元-明","明","明代","大明万历年制款","清中期","清同治","清康熙","清嘉庆","清光绪","宋金","元末明初","清中期","大清雍正年制款","大清乾隆年制款","清末","清初", "元-明初","南北朝","明永乐","明宣德","明成化","明崇祯","明晚清初","民国","宋代","金(或元)","雍正年制款","大清","乾隆年制款","中和堂(款)","金元","乾隆御制","明代弘治年制","清代","大清雍正","大清同治年制款", "明早期","宣德","崇祯","新石器时代","春秋-战国","战国-汉","汉","汉代","古汉代","西汉","东汉","清代乾隆款","乾隆","北魏","明末","清末","唐-五代","明以前","康熙款", "商代","洪武","南","商周","年制","大年制","南","万历","康熙","嘉靖","雍正","光绪","(大年制楷书款)","万历",",光绪(康熙款)","北,","内府",",万历",",雍正",",康熙",",嘉靖", "春秋战国","五代","战国","永乐","大弘治","正德","大正德","枢府","老玉","中期","早期","明,","(清)","元·","(元)","东","古玉","宋·","金(或元)·","清乾隆·","明永乐·","明万历·", "南宋·","北宋·","“大清光绪”","(早期)","(清光绪款)","柜台面议"]; arsort($keys); $title=str_replace($keys,"",$title); return $title; } public function notice(){ $where=['n_kind'=>4,'n_status'=>1]; $lists=Db::name('bsgg')->field('n_title,n_id,n_hits,n_top,n_cid,n_img,n_time,n_kind')->where($where)->order('n_order desc,n_time desc')->paginate(config('paginate.list_rows')); $show=$lists->render(); return json_encode(['code' => 200, 'msg' => '上传成功', 'data' =>['list'=>$lists,'page'=>$show]], JSON_UNESCAPED_UNICODE); } /** * 艺术资产托管 * @return string */ public function category(){ $keyword=input('keyword',''); $kind=input('kind','','intval'); if(request()->isPost()&&($keyword||$kind==11)){ $rule = [ '__category__' =>'require|token:__category__' ]; $message =[ '__category__.require'=>'令牌缺失' ]; $validate=new Validate($rule,$message); $result=$validate->check(input()); if(!$result){ $token=request()->token('__category__'); $this->error($validate->getError(),url('news/category',['kind'=>$kind]),['token'=>$token]); } } $childs=[]; $parents=[]; $state=input('state','','intval'); $cid=input('cid','','intval'); $kid=input('kid','','intval'); $states=[]; $verpage=30; if($kind==4){ $childs=config("tuoguan.childs"); $parents=config('tuoguan.parents'); $states=[1=>['name'=>'预披露'],['name'=>'正式披露'],['name'=>'成交公示'],['name'=>'艺术资产转让']]; $states=[]; }else if($kind==11){ $parents=config('building.parents'); $classs=config('building.class'); $sizes=config('building.size'); $prices=config('building.price'); $years=config('building.year'); $this->assign('classs',$classs); $this->assign('sizes',$sizes); $this->assign('prices',$prices); $this->assign('years',$years); $states=[1=>['name'=>'信息披露'],['name'=>'正式披露'],['name'=>'成交公示'],['name'=>'艺术资产转让']]; if($cid){ $parents=[1=>'金溪托管专区',2=>'普宁托管专区']; } }else if($kind==15){ $parents=config('building.parents'); $classs=config('building.class'); $sizes=config('building.size'); $prices=config('building.price'); $years=config('building.year'); $this->assign('classs',$classs); $this->assign('sizes',$sizes); $this->assign('prices',$prices); $this->assign('years',$years); $states=[1=>['name'=>'信息披露'],['name'=>'正式披露'],['name'=>'成交公示'],['name'=>'艺术资产转让']]; if($cid){ $parents=[1=>'德化专区',2=>'金溪专区',3=>'普宁专区']; } }else if($kind==3){ $parents=[64=>'音乐资产托管']; foreach ($parents as $pid=>$parent){ $types=Db::name('type')->field('id,type_name')->where(['type_type'=>$pid,'type_status'=>1])->select(); if(count($types)){ $ids=array_column($types,'id'); $names=array_column($types, 'type_name'); $childs[$pid]=array_combine($ids,$names); } } }else if($kind==1){ $parents=[1=>'登记托管展示']; }else if($kind==2){ $parents=[1=>'国有业务']; }else if($kind==5){ $parents=[1=>'艺品拍']; }else if($kind==7){ $parents=[1=>'艺版拍']; }else if($kind==8){ $parents=[1=>'文版通(区块链基地)']; }else if($kind==9){ $configs=config('artbook'); $keys=array_keys($configs); $titles=array_column($configs,'title'); $parents=array_combine($keys,$titles); $childs=[]; } $page=input('page',1); $params=request()->param(); $cprice=isset($params['cprice'])?$params['cprice']:[]; $csize=isset($params['csize'])?$params['csize']:[]; $cclass=isset($params['cclass'])?$params['cclass']:[]; $cyear=isset($params['cyear'])?$params['cyear']:[]; $cparent=isset($params['cparent'])?$params['cparent']:[]; if(is_string($cprice))$cprice=explode(',', $cprice); if(is_string($csize))$csize=explode(',', $csize); if(is_string($cclass))$cclass=explode(',', $cclass); if(is_string($cyear))$cyear=explode(',', $cyear); if(is_string($cparent))$cparent=explode(',', $cparent); $mprice=input('mprice'); $sprice=input('sprice'); if($mprice)$mprice=intval($mprice); if($sprice)$sprice=intval($sprice); $showtype=input('showtype',0,'intval'); $yearsort=input('yearsort','asc'); $pricesort=input('pricesort','asc'); $orderkey=input('orderkey','c_count'); if(!in_array($orderkey,['c_time','c_count']))$orderkey='c_count'; if(!in_array($yearsort,['asc','desc']))$yearsort='asc'; if(!in_array($pricesort,['asc','desc']))$pricesort='asc'; $this->assign('orderkey',$orderkey); $this->assign('yearsort',$yearsort); $this->assign('pricesort',$pricesort); $this->assign('showtype',$showtype); $this->assign('page',$page); $this->assign('keyword',$keyword); $this->assign('mprice',$mprice); $this->assign('sprice',$sprice); $this->assign('cparent',$cparent); $this->assign('csize',$csize); $this->assign('cclass',$cclass); $this->assign('cyear',$cyear); $this->assign('cprice',$cprice); if($cid||$kind==1||$kind==11||$kind==15||$state){ if($state){ $categorys=[]; $where=['c_status'=>1,'c_kind'=>$kind]; $where['c_state']=$state; $stateslist=[1=>'预披露','正式披露','成交公示','艺术资产转让']; $parent=isset($stateslist[$state])?$stateslist[$state]:''; foreach ($states as $k=>$v){ if($k!=$state)unset($states[$k]); } }else if($kind==1||($kind==11&&empty($cid))||($kind==15&&empty($cid))){ $categorys=isset($childs[1])?$childs[1]:[]; $where=['c_status'=>1,'c_kind'=>$kind]; $parent=isset($parents[1])?$parents[1]:''; }else if($kind==9){ $categorys=isset($childs[$cid])?$childs[$cid]:[]; $where=['c_status'=>1,'c_kind'=>$kind]; $where['c_parent']=$cid; $parent=isset($parents[$cid])?$parents[$cid]:''; }else{ $categorys=isset($childs[$cid])?$childs[$cid]:[]; if($kind==4){ $where=['c_status'=>1,'c_kind'=>$kind]; $where['c_parent']=array('like',[$cid.',%','%,'.$cid.'%',$cid],'OR'); }else if($kind==11){ $where=['c_status'=>1,'c_kind'=>$kind]; if($cid)$where['c_type']=$cid; }else if($kind==15){ $where=['c_status'=>1,'c_kind'=>$kind]; if($cid)$where['c_type']=$cid; }else if($kind==5){ $where=['c_status'=>1,'c_kind'=>$kind]; }else{ $where=['c_status'=>1,'c_kind'=>$kind,'c_type'=>$cid]; } foreach ($categorys as $k=>$v){ if($kind==4){ $where['c_child']=array('like',[$cid.'-'.$k.',%','%,'.$cid.'-'.$k.'%','%'.$cid.'-'.$k.'%'],'OR'); }else{ $where['c_cid']=$k; } $check=Db::name('finance')->where($where)->count(); if($check==0)unset($categorys[$k]); } if(isset($where['c_cid']))unset($where['c_cid']); if(isset($where['c_child']))unset($where['c_child']); $parent=isset($parents[$cid])?$parents[$cid]:''; } $this->assign('categorys',$categorys); if($kid){ if($kind==4){ $where['c_child']=array('like',[$cid.'-'.$kid.',%','%,'.$cid.'-'.$kid.'%','%'.$cid.'-'.$kid.'%'],'OR'); }else{ $where['c_cid']=$kid; } } if($cid==16){ $where=['n_kind'=>17,'n_status'=>1]; $db=Db::name('news')->field('n_id as c_id,n_title as c_name,n_img as c_logo,n_kind as c_kind,n_content as c_content')->where($where)->order('n_order desc,n_time desc'); $products=$db->paginate($verpage,false,['query'=>get_query()]); }else{ $db=Db::name('finance')->where($where); if($keyword){ $db->where('c_name|c_code|c_year|c_class','like','%'.$keyword.'%'); } if($cparent){ $pidarr=[]; foreach ($cparent as $cpid){ $cpid=intval($cpid); array_push($pidarr,$cpid.',%'); array_push($pidarr,'%,'.$cpid.'%'); array_push($pidarr,$cpid); } $db->where(['c_parent'=>['like',$pidarr,'OR']]); } if($cclass){ $pidarr=[]; foreach ($cclass as $cpid){ array_push($pidarr,intval($cpid)); } $db->where("CAST(`c_class` AS SIGNED) in (".implode(",",$pidarr).")"); } if($cyear){ $pidarr=[]; foreach ($cyear as $cpid){ array_push($pidarr,intval($cpid)); } $db->where("CAST(`c_year` AS SIGNED) in (".implode(",",$pidarr).")"); } if($csize){ $sizestr=""; $skey='c_size'; if($kind==11||$kind==15)$skey='capital_area'; foreach ($csize as $cpid){ switch ($cpid){ case 1: $sizestr.="(".$skey."<=100) "; break; case 2: $sizestr.="or ((".$skey."<=200) and (".$skey.">100)) "; break; case 3: $sizestr.="or ((".$skey."<=300) and (".$skey.">200)) "; break; case 4: $sizestr.="or ((".$skey."<=500) and (".$skey.">300)) "; break; case 5: $sizestr.="or ((".$skey."<=800) and (".$skey.">500)) "; break; case 6: $sizestr.="or ((".$skey."<=1000) and (".$skey.">800)) "; break; case 7: $sizestr.="or (".$skey.">1000) "; break; } } if($sizestr){ $sizestr=ltrim($sizestr,'or'); $db->where($sizestr); } } if($cprice){ $pricestr=""; foreach ($cprice as $cpid){ switch ($cpid){ case 1: $pricestr.="(CAST(replace(`c_price`,',','') AS SIGNED)<=10000) "; break; case 2: $pricestr.="or ((CAST(replace(`c_price`,',','') AS SIGNED)<=1000000) and (CAST(replace(`c_price`,',','') AS SIGNED)>10000)) "; break; case 3: $pricestr.="or ((CAST(replace(`c_price`,',','') AS SIGNED)<=5000000) and (CAST(replace(`c_price`,',','') AS SIGNED)>1000000)) "; break; case 4: $pricestr.="or ((CAST(replace(`c_price`,',','') AS SIGNED)<=10000000) and (CAST(replace(`c_price`,',','') AS SIGNED)>5000000)) "; break; case 5: $pricestr.="or (CAST(replace(`c_price`,',','') AS SIGNED)>100000000) "; break; } } if($pricestr){ $pricestr=ltrim($pricestr,'or'); $db->where($pricestr); } } if($mprice){ $db->where('c_price','<=',$mprice); } if($sprice){ $db->where('c_price','>=',$sprice); } $order=['c_order'=>'desc','c_time'=>'desc']; if($kind==4){ $order=[]; $order['c_year']=$yearsort; $order['c_price']=$pricesort; $order['c_order']='desc'; } if($kind==11||$kind==15){ $verpage=28; $order=[]; $order[$orderkey]='desc'; $order['c_order']='desc'; } $products=$db->order($order)->paginate($verpage,false,['query'=>get_query()]); } $tpage=1; $ppage=''; $npage=''; if(count($products)){ $tpage=$products->lastPage(); if($page>1)$ppage=url('category',['kind'=>$kind,'page'=>$page-1]); if($page<$tpage)$npage=url('category',['kind'=>$kind,'page'=>$page+1]); } $this->assign('curpage',$page); $this->assign('totalpage',$tpage); $this->assign('prevpage',$ppage); $this->assign('nextpage',$npage); $show = $products->render(); if($products){ $products=$products->toArray(); $products=$products['data']; if($cid==16){ foreach ($products as $k=>$item){ $products[$k]['c_jump']=url('news/artist',['c_id'=>$item['c_id']]); $products[$k]['c_code']=''; $products[$k]['c_price']=''; $products[$k]['c_gprice']=''; $products[$k]['c_tprice']=''; $products[$k]['c_gptime']=''; $products[$k]['c_count']=''; if($kind==4){ $products[$k]['c_name']=$this->replaceTitle($item['c_name']); $products[$k]['c_content']=$this->replaceTitle($item['c_content']); } } }else{ foreach ($products as $k=>$item){ if($item['c_jump']){ if(strpos(strtolower($item['c_jump']),'http')===false){ $products[$k]['c_jump']='http://'.$item['c_jump']; } } if($kind==4){ $products[$k]['c_name']=$this->replaceTitle($item['c_name']); $products[$k]['c_content']=$this->replaceTitle($item['c_content']); } if($kind==11||$kind==15){ $c_parent=''; $parents=explode(',',$item['c_parent']); if(count($parents)){ $c_parent=array_pop($parents); } $products[$k]['c_parent']=$c_parent; } } } } if($state){ $states[$state]['products']=$products; } $this->assign('parent',$parent); $this->assign('products',$products); $this->assign('show',$show); }else{ $list=[]; if(count($states)){ $where=['c_status'=>1,'c_kind'=>$kind]; foreach ($states as $id=>$item){ $where['c_state']=$id; $db=Db::name('finance')->where($where); $products=$db->order('c_order desc,c_time desc')->limit(5)->select(); foreach ($products as $k=>$item){ if($item['c_jump']){ if(strpos(strtolower($item['c_jump']),'http')===false){ $products[$k]['c_jump']='http://'.$item['c_jump']; } } if($kind==4){ $products[$k]['c_name']=$this->replaceTitle($item['c_name']); $products[$k]['c_content']=$this->replaceTitle($item['c_content']); } } $states[$id]['products']=$products; } } if($kind==4&&$cid==''){ /* $row=[]; $id=11; $row['id']=$id; $row['name']=$parents[$id]; $childrow=isset($childs[$id])?$childs[$id]:[]; $row['has']=count($childrow)?1:0; if(count($childrow)){ foreach ($childrow as $k=>$v){ $swhere=['c_status'=>1,'c_kind'=>$kind]; $swhere['c_child']=array('like',[$k.',%','%,'.$k.'%',$k],'OR'); $check=Db::name('finance')->where($swhere)->count(); if($check==0)unset($childrow[$k]); } } $row['childs']=$childrow; $where=['c_status'=>1,'c_kind'=>$kind]; $where['c_parent']=array('like',[$id.',%','%,'.$id.'%',$id],'OR'); $db=Db::name('finance')->where($where)->order('c_order desc,c_time desc'); if($keyword){ $db->where('c_name|c_code','like','%'.$keyword.'%'); } $products=$db->limit(10)->select(); foreach ($products as $k=>$item){ if($item['c_jump']){ if(strpos(strtolower($item['c_jump']),'http')===false){ $products[$k]['c_jump']='http://'.$item['c_jump']; } } if($kind==4){ $products[$k]['c_name']=$this->replaceTitle($item['c_name']); $products[$k]['c_content']=$this->replaceTitle($item['c_content']); } } $row['products']=$products; array_push($list, $row); */ $row=[]; $row['id']='all'; $row['name']="专区"; $childrow=['11'=>'古陶瓷专区']; $parentrow=['16'=>'艺术公馆']; foreach ($parents as $k=>$jow){ if($k>4&&$k<11){ $childrow[$k]=$jow; }else if($k==18){ $childrow[$k]=$jow; }else if($k>11&&$k!=18&&$k!=16){ $parentrow[$k]=$jow; } } krsort($childrow); if(count($childrow)){ foreach ($childrow as $k=>$v){ $swhere=['c_status'=>1,'c_kind'=>$kind]; $swhere['c_parent']=array('like',[$k.',%','%,'.$k.'%',$k],'OR'); $check=Db::name('finance')->where($swhere)->count(); if($check==0&&$k!=11)unset($childrow[$k]); } } $row['has']=count($childrow)?1:0; $row['childs']=$childrow; $where=['c_status'=>1,'c_kind'=>$kind]; $where['c_parent']=array('<>',10); $db=Db::name('finance')->where($where)->order('c_order desc,c_time desc'); if($keyword){ $db->where('c_name|c_code|c_year|c_class','like','%'.$keyword.'%'); } if(count($childrow)){ $db->where(['c_parent'=>['in',array_keys($childrow)]]); } $products=$db->limit(10)->select(); foreach ($products as $k=>$item){ if($item['c_jump']){ if(strpos(strtolower($item['c_jump']),'http')===false){ $products[$k]['c_jump']='http://'.$item['c_jump']; } } if($kind==4){ $products[$k]['c_name']=$this->replaceTitle($item['c_name']); $products[$k]['c_content']=$this->replaceTitle($item['c_content']); } $cparent=$item['c_parent']; $cparent=explode(",",$cparent); $products[$k]['c_parent']=count($cparent)?$cparent[0]:''; } $row['products']=$products; array_push($list, $row); foreach ($parentrow as $k=>$item){ $id=$k; $row=[]; $row['id']=$id; $row['name']=$item; $childrow=isset($childs[$id])?$childs[$id]:[]; $row['has']=count($childrow)?1:0; if(count($childrow)){ foreach ($childrow as $k=>$v){ $swhere=['c_status'=>1,'c_kind'=>$kind]; $swhere['c_child']=array('like',[$id.'-'.$k.',%','%,'.$id.'-'.$k.'%','%'.$id.'-'.$k.'%'],'OR'); $check=Db::name('finance')->where($swhere)->count(); if($check==0)unset($childrow[$k]); } } $row['childs']=$childrow; $where=['c_status'=>1,'c_kind'=>$kind]; $where['c_parent']=array('like',[$id.',%','%,'.$id.'%',$id],'OR'); if($id==16){ $where=['n_kind'=>17,'n_status'=>1]; $db=Db::name('news')->field('n_id as c_id,n_title as c_name,n_img as c_logo,n_kind as c_kind,n_content as c_content')->where($where)->order('n_order desc,n_time desc'); $products=$db->limit(10)->select(); foreach ($products as $k=>$item){ $products[$k]['c_jump']=url('news/artist',['c_id'=>$item['c_id']]); $products[$k]['c_code']=''; $products[$k]['c_price']=''; $products[$k]['c_gprice']=''; $products[$k]['c_tprice']=''; if($kind==4){ $products[$k]['c_name']=$this->replaceTitle($item['c_name']); $products[$k]['c_content']=$this->replaceTitle($item['c_content']); } } }else{ $db=Db::name('finance')->where($where)->order('c_order desc,c_time desc'); if($keyword){ $db->where('c_name|c_code','like','%'.$keyword.'%'); } $products=$db->limit(10)->select(); foreach ($products as $k=>$item){ if($item['c_jump']){ if(strpos(strtolower($item['c_jump']),'http')===false){ $products[$k]['c_jump']='http://'.$item['c_jump']; } } if($kind==4){ $products[$k]['c_name']=$this->replaceTitle($item['c_name']); $products[$k]['c_content']=$this->replaceTitle($item['c_content']); } } } $row['products']=$products; array_push($list, $row); } $this->assign('menulist',$list); }else{ if($kind==4&&$cid==0){ foreach ($parents as $k=>$item){ if(($k<5||$k>10)&&$k!=18){unset($parents[$k]);} } } foreach ($parents as $id=>$item){ $row=[]; $row['id']=$id; $row['name']=$item; $childrow=isset($childs[$id])?$childs[$id]:[]; $row['has']=count($childrow)?1:0; if($kind==1){ $where=['c_status'=>1,'c_kind'=>$kind]; foreach ($childrow as $k=>$v){ $where['c_type']=$k; $check=Db::name('finance')->where($where)->count(); if($check==0)unset($childrow[$k]); } unset($where['c_type']); }else if($kind==9){ $where=['c_status'=>1,'c_kind'=>$kind,'c_parent'=>$id]; unset($where['c_type']); }else{ if($kind==4||$kind==11){ $where=['c_status'=>1,'c_kind'=>$kind]; $where['c_parent']=array('like',[$id.',%','%,'.$id.'%',$id],'OR'); }else if(in_array($kind,[5,11,7,8])){ $where=['c_status'=>1,'c_kind'=>$kind]; }else{ $where=['c_status'=>1,'c_kind'=>$kind,'c_type'=>$id]; } if(count($childrow)){ foreach ($childrow as $k=>$v){ if($kind==4){ $where['c_child']=array('like',[$k.',%','%,'.$k.'%',$k],'OR'); }else{ $where['c_cid']=$k; } $check=Db::name('finance')->where($where)->count(); if($check==0)unset($childrow[$k]); } if(isset($where['c_cid']))unset($where['c_cid']); if(isset($where['c_child']))unset($where['c_child']); } } $row['childs']=$childrow; $db=Db::name('finance')->where($where)->order('c_order desc,c_time desc'); if($keyword){ $db->where('c_name|c_code|c_year|c_class','like','%'.$keyword.'%'); } if(in_array($kind,[7,8])){ $products=$db->select(); }else{ $products=$db->limit(10)->select(); } foreach ($products as $k=>$item){ if($item['c_jump']){ if(strpos(strtolower($item['c_jump']),'http')===false){ $products[$k]['c_jump']='http://'.$item['c_jump']; } } if($kind==4){ $products[$k]['c_name']=$this->replaceTitle($item['c_name']); $products[$k]['c_content']=$this->replaceTitle($item['c_content']); } } $row['products']=$products; if($kind==4&&$cid==0){ $list[$id-1]=$row; }else{ array_push($list,$row); } } if($kind==4&&$cid==0){ krsort($list); } } if($kind==4&&$cid==0){ //krsort($list); $this->assign('menulist',$list); } if($kind==9&&$cid==0){ if(isset($list[11])){ $arr=$list[11]; unset($list[11]); array_unshift($list,$arr); } } $this->assign('list',$list); } $this->assign('states',$states); $this->assign('childs',$childs); $this->assign('parents',$parents); $this->assign('keyword',$keyword); $this->assign('kind',$kind); $this->assign('cid',$cid); $this->assign('kid',$kid); $this->assign('state',$state); $lkcid=15; if($kind==11)$lkcid=18; if($kind==15)$lkcid=20; $banners=Db::name('link')->where(['lk_status'=>1,'lk_cid'=>$lkcid])->order('lk_order desc')->select(); $this->assign('banners',$banners); $tpl=":financecategory"; if($kind==4&&$cid=='')$tpl=":financecategory4"; if($kind==11&&$cid=='')$tpl=":financecategory11"; if($kind==15&&$cid=='')$tpl=":financecategory15"; return $this->view->fetch($tpl); } public function bigdata(){ $banners=Db::name('link')->where(['lk_status'=>1,'lk_cid'=>21])->order('lk_order asc,lk_id asc')->select(); $this->assign('banners',$banners); $verpage=8; $keyword=input("keyword"); $cseller=input("c_seller"); $cpay=input("c_pay",''); $ctype=input("c_type",''); $order='c_order desc,c_id desc'; $db=Db::name('bigdata')->where(array('c_status'=>1)); if(!empty($cpay)&&$cpay!=0){ $db->where(array('c_pay'=>$cpay)); } if(!empty($ctype)&&$ctype!=0){ $db->where(array('c_type'=>$ctype)); } if(!empty($keyword)){ $db->where('c_name|c_code','like','%'.$keyword.'%'); } if($cseller){ $db->where('c_seller','like','%'.$cseller.'%'); } $products=$db->order($order)->paginate($verpage,false,['query'=>get_query()]); $page=input('page',1); $tpage=1; if(count($products)){ $tpage=$products->lastPage(); } $this->assign('totalpage',$tpage); $this->assign('curpage',$page); $show = $products->render(); $this->assign('keyword',$keyword); $this->assign('cseller',$cseller); $this->assign('ctype',$ctype); $this->assign('cpay',$cpay); $this->assign('products',$products); $this->assign('show',$show); $this->assign('kind',17); return $this->view->fetch(":bigcategory"); } public function search(){ $keyword=input('keyword',''); $option=input('option','1','intval'); $kind=input('kind','','intval'); if($keyword&&request()->isPost()){ $rule = [ '__searchcate__' =>'require|token:__searchcate__' ]; $message =[ '__searchcate__.require'=>'令牌缺失' ]; $validate=new Validate($rule,$message); $result=$validate->check(input()); if(!$result){ $token=request()->token('__searchcate__'); $this->error($validate->getError(),url('news/search',['kind'=>$kind]),['token'=>$token]); } } $banners=Db::name('link')->where(['lk_status'=>1,'lk_cid'=>15])->order('lk_order desc')->select(); $this->assign('banners',$banners); //古建资产托管 $c_parent=input('c_parent','','intval'); $c_class=input('c_class',''); $c_year=input('c_year',''); $c_size=input('c_size',''); $c_price=input('c_price',''); $this->assign('c_parent',$c_parent); $this->assign('c_class',$c_class); $this->assign('c_year',$c_year); $this->assign('c_size',$c_size); $this->assign('c_price',$c_price); $cid=input('cid',1); $page=input('page',1); $mprice=input('mprice'); $sprice=input('sprice'); if($sprice)$sprice=intval($sprice); if($mprice)$mprice=intval($mprice); $showtype=input('showtype',0,'intval'); $yearsort=input('yearsort','asc'); $pricesort=input('pricesort','asc'); if(!in_array($yearsort,['asc','desc']))$yearsort='asc'; if(!in_array($pricesort,['asc','desc']))$pricesort='asc'; $this->assign('yearsort',$yearsort); $this->assign('pricesort',$pricesort); $this->assign('showtype',$showtype); $this->assign('page',$page); $this->assign('keyword',$keyword); $this->assign('mprice',$mprice); $this->assign('sprice',$sprice); $this->assign('kind',$kind); if($keyword)$keyword=$this->replaceTitle($keyword); $where=['c_status'=>1,'c_kind'=>$kind]; $db=Db::name('finance')->where($where); if($keyword){ if($option==1){ $db->where(['c_name|c_code|c_year|c_class'=>array('like',[$keyword.'%','%'.$keyword.'%',$keyword],'OR')]); }else{ $db->where(['c_author'=>array('like',[$keyword.'%','%'.$keyword.'%',$keyword],'OR')]); } } if($mprice){ $db->where('c_price','<=',$mprice); } if($sprice){ $db->where('c_price','>=',$sprice); } $order=['c_order'=>'desc','c_time'=>'desc']; if($kind==4){ $order=[]; $order['c_year']=$yearsort; $order['c_price']=$pricesort; $order['c_order']='desc'; } if($kind==11){ $parents=config('building.parents'); $classs=config('building.class'); $sizes=config('building.size'); $prices=config('building.price'); $years=config('building.year'); $this->assign('parents',$parents); $this->assign('classs',$classs); $this->assign('sizes',$sizes); $this->assign('prices',$prices); $this->assign('years',$years); if($c_parent)$db->where(['c_parent'=>array('like',[$c_parent.',%','%,'.$c_parent.'%',$c_parent],'OR')]); if($c_class)$db->where(['c_class'=>$c_class]); if($c_year)$db->where(['c_year'=>$c_year]); //if($c_size)$db->where(['c_size'=>$c_size]); if($c_price){ $mprice=''; $sprice=''; switch ($c_price){ case 1: $mprice=10000; $sprice=''; break; case 2: $mprice=1000000; $sprice=10000; break; case 3: $mprice=5000000; $sprice=1000000; break; case 4: $mprice=10000000; $sprice=5000000; break; case 5: $mprice=''; $sprice=10000000; break; } if($mprice)$db->where('c_price','<=',$mprice); if($sprice)$db->where('c_price','>=',$sprice); } if($c_size){ $msize=''; $ssize=''; switch ($c_size){ case 1: $msize=100; $ssize=''; break; case 2: $msize=200; $ssize=100; break; case 3: $msize=200; $ssize=300; break; case 4: $msize=500; $ssize=300; break; case 5: $msize=800; $ssize=500; break; case 6: $msize=1000; $ssize=800; break; case 7: $msize=''; $ssize=1000; break; } $skey='c_size'; if($kind==11)$skey='capital_area'; if($msize)$db->where($skey,'<=',$msize); if($ssize)$db->where($skey,'>=',$ssize); } } $products=$db->order($order)->paginate(30,false,['query'=>get_query()]); $show = $products->render(); if($products){ $products=$products->toArray(); $products=$products['data']; foreach ($products as $k=>$item){ if($item['c_jump']){ if(strpos(strtolower($item['c_jump']),'http')===false){ $products[$k]['c_jump']='http://'.$item['c_jump']; } } if($kind==4){ $products[$k]['c_name']=$this->replaceTitle($item['c_name']); $products[$k]['c_content']=$this->replaceTitle($item['c_content']); } } } $this->assign('products',$products); $this->assign('show',$show); return $this->view->fetch(":financesearch"); } /** * 艺术资产托管详情 * @return string */ public function finance() { $c_id=input('c_id',0,'intval'); $c_kind=input('kind',0,'intval'); $c_type=input('parent','','intval'); $c_state=input('state','','intval'); $title='文化金融'; if($c_kind>3)$title='艺术金融'; if($c_kind==17)$title='数据超市'; $this->assign('title',$title); if($c_state){ Db::name('finance')->where(['c_status'=>1,'c_id'=>$c_id])->setInc('c_count'); } $this->assign('state',$c_state); $table='finance'; if($c_kind==17)$table='bigdata'; return $this->cult_info(3,'',$title,$table,$c_id,$c_kind,$c_type,$c_state); } public function artist(){ $this->assign('kind',4); $this->assign('title','艺术金融'); $this->assign('parent','艺术公馆'); $c_id=input('c_id',0,'intval'); $list=Db::name('news')->where(['n_status'=>1,'n_kind'=>17,'n_id'=>$c_id])->find(); $photos=[]; if($list){ $pids=explode(";",$list['n_pids']); if(count($pids)){ $photos=Db::name('finance')->field('c_id,c_logo,c_name')->where(['c_id'=>['in',$pids],'c_status'=>1])->select(); } } $list['photos']=$photos; $this->assign('list',$list); return $this->view->fetch(':artist'); } private function cult_infotow($curren_menu_id,$type,$curren_title,$news_table,$c_id) { $this->assign('curren_menu_id',$curren_menu_id); $this->assign('type',$type); $this->assign('curren_title',$curren_title); $list=Db::name($news_table)->where(['c_status'=>1,'c_id'=>$c_id])->find(); $this->assign('list',$list); return $this->view->fetch(":cultTow"); } private function cult_info($curren_menu_id,$type,$curren_title,$news_table,$c_id,$c_kind='',$c_type='',$c_state='') { $this->assign('curren_menu_id',$curren_menu_id); $this->assign('type',$type); $this->assign('curren_title',$curren_title); $this->assign('c_type',$c_type); $list=Db::name($news_table)->where(['c_status'=>1,'c_id'=>$c_id])->find(); if(!$list){ $this->error("该纪录不存在"); } $tpl=":cult"; if($c_kind==4){ $tpl=":financedetail4"; $childs=config("tuoguan.childs"); $showtypes=config("tuoguan.parents"); if(empty($c_type)){ $parents=explode(',',$list['c_parent']); if(count($parents)){ $c_type=array_pop($parents); } } $pic_list = array_filter(explode(",", $list['c_photos'])); $list['photos']=$pic_list; $parent=isset($showtypes[$c_type])?$showtypes[$c_type]:''; if($c_state){ $states=[1=>'预披露','正式披露','成交公示','艺术资产转让']; $parent=isset($states[$c_state])?$states[$c_state]:''; } $this->assign('c_parent',$c_type); $this->assign('parent',$parent); $cshowtypes=isset($childs[$c_type])?$childs[$c_type]:[]; $this->assign('showtypes',$cshowtypes); $cates=[1=>'A担保回购式','B撮合回购式','C登记备案式']; $this->assign('showcates',$cates); $this->assign('showchilds',$childs); $this->assign('title','艺术品资产托管平台'); } if($c_kind==6){ $tpl=":financedetail6"; $where=array(); $where['new_flag']=1; $where['apply_type']=6; $where['apply_id']=$c_id; $where['code']=['neq','']; $list=Db::name('cult4baseinfo')->where($where)->find(); $list['c_notice']=$list['c_notice']?json_decode($list['c_notice'],true):[]; $list['c_base']=$list['c_base']?json_decode($list['c_base'],true):[]; $list['c_transferor']=$list['c_transferor']?json_decode($list['c_transferor'],true):[]; } if($c_kind==11){ $tpl=":financedetail11"; $showtypes=config("building.parents2"); $parent=isset($showtypes[$c_type])?$showtypes[$c_type]:''; if($list){ $pic_list = array_filter(explode(",", $list['c_photos'])); if(empty($c_type)){ $parents=explode(',',$list['c_parent']); if(count($parents))$parent=isset($showtypes[$parents[0]])?$showtypes[$parents[0]]:''; } $list['photos']=$pic_list; $level=$list['capital_level']; $list['capital_level']=$level; $elems=['1'=>'资产所有权','资产使用权','资产收益权','资产租赁权']; $capele=$list['capital_elem']; if($capele)$capele=explode(',',$capele); if(is_array($capele)){ $elestr=''; foreach ($capele as $erow){ if(isset($elems[$erow]))$elestr.=$elems[$erow].';'; } $capele=rtrim($elestr,';'); } $list['capital_elem']=$capele; } $this->assign('parent',$parent); $this->assign('c_parent',$c_type); $this->assign('title','古建资产管理计划'); } if($c_kind==15){ $tpl=":financedetail15"; $showtypes=config("building.parents3"); $showchilds=config("building.childs2"); $c_child=intval($list['c_child']); if($list){$c_type=intval($list['c_parent']);} $parent=isset($showtypes[$c_type])?$showtypes[$c_type]:''; $child=''; if($list){ foreach ($showchilds as $jo){ foreach ($jo as $j=>$vo){ if($c_child==$j)$child=$vo; } } $pic_list = array_filter(explode(",", $list['c_photos'])); if(empty($c_type)){ $parents=explode(',',$list['c_parent']); if(count($parents))$parent=isset($showtypes[$parents[0]])?$showtypes[$parents[0]]:''; } $list['photos']=$pic_list; $level=$list['capital_level']; $list['capital_level']=$level; $elems=['1'=>'资产所有权','资产使用权','资产收益权','资产租赁权']; $capele=$list['capital_elem']; if($capele)$capele=explode(',',$capele); if(is_array($capele)){ $elestr=''; foreach ($capele as $erow){ if(isset($elems[$erow]))$elestr.=$elems[$erow].';'; } $capele=rtrim($elestr,';'); } $list['capital_elem']=$capele; } $this->assign('parent',$parent); $this->assign('child',$child); $this->assign('c_parent',$c_type); $this->assign('title','乡村振兴'); } if($c_kind==17){ $tpl=":financedetail17"; $states=[1=>'复制权','发行权','出租权','展览权','改编权','表演权','放映权','广播','摄制权','翻译权','汇编权','信息网络传播权']; $right=$list['c_right']; $rights=explode(',',$right); $rigtxt=''; if(count($rights)){ foreach ($rights as $r){ $rigtxt.=isset($states[$r])?$states[$r].'、':''; } } $list['c_right']=rtrim($rigtxt,'、'); $sother=$list['c_sother']; $states2=[1=>'软件开发','文化数字内容服务','互联网生活服务平台','可穿戴智能设备制造','广播影视节目制作','文化娱乐休闲服务','玩具制造','动漫游戏','教育','服装','其他']; $scene=$list['c_scene']; $scenes=explode(',',$scene); $scenetxt=''; if(count($scenes)){ foreach ($scenes as $r){ if($r==11){ $stxt=isset($states2[$r])?$states2[$r]:''; if($sother)$stxt.='('.$sother.')'; $scenetxt.=$stxt.'、'; }else{ $scenetxt.=isset($states2[$r])?$states2[$r].'、':''; } } } $list['c_scene']=rtrim($scenetxt,'、'); try { $childs=json_decode($list['c_childs'],true); if(count($childs)){ foreach ($childs as $k=>$c){ $item=array(); $child=json_decode($c,true); foreach ($child as $j){ $js=explode("=", $j); $item[$js[0]]=$js[1]; } $childs[$k]=$item; } } $list['c_childs']=$childs; } catch (\Exception $e) { $list['c_childs']=array(); } $relates=Db::name($news_table)->where(['c_status'=>1,'c_seller'=>$list['c_seller'],'c_id'=>['neq',$list['c_id']]])->order('c_order desc,c_id desc')->limit(4)->select(); db('bigdata')->where(['c_id'=>$c_id])->setInc('c_click'); $this->assign('relates',$relates); } if($c_kind==13){ $tpl=":financedetail13"; $showtypes=['1'=>'服务联盟','产业联盟 ','投资联盟']; $parent="策略联盟"; if($list){ $pic_list = array_filter(explode(",", $list['c_photos'])); $list['photos']=$pic_list; $list['c_mold']=$showtypes[$list['c_mold']]; } $this->assign('parent',$parent); $this->assign('title','古建资产管理中心'); } if($c_kind==14){ $tpl=":financedetail14"; $parent="项目进场"; if($list){ $pic_list = array_filter(explode(",", $list['c_photos'])); $list['photos']=$pic_list; } $this->assign('parent',$parent); $this->assign('title','古建资产管理中心'); } if($c_kind==9){ $pic_list = array_filter(explode(",", $list['c_photos'])); $list['photos']=$pic_list; $url =SITE_PATH.url('finance',['c_id'=>$c_id,'kind'=>$c_kind]); //二维码内容 $errorCorrectionLevel = 'L';//容错级别 $matrixPointSize = 6;//生成图片大小 //生成二维码图片 $file=ROOT_PATH.'extend'.DS.'phpqrcode'.DS.'phpqrcode.php'; include($file); $path=config('upload_path').DS.'qrcode'.DS; $file=$path.'qrcode'.$c_id.'.png'; if(!is_dir('.'.$path))@mkdir('.'.$path,0755,true); $filepath='.'.$file; if(!file_exists($filepath)){ touch($filepath); \QRcode::png($url, '.'.$file, $errorCorrectionLevel, $matrixPointSize, 2); $logo =false;//准备好的logo图片 需要加入到二维码中的logo $QR=$filepath;//已经生成的原始二维码图 $QR = imagecreatefromstring(file_get_contents($QR)); if ($logo !== FALSE) { $logo = imagecreatefromstring(file_get_contents($logo)); $QR_width =imagesx($QR);//二维码图片宽度 $QR_height =imagesy($QR);//二维码图片高度 $logo_width =imagesx($logo);//logo图片宽度 $logo_height =imagesy($logo);//logo图片高度 $logo_qr_width = $QR_width / 5; $scale = $logo_width/$logo_qr_width; $logo_qr_height = $logo_height/$scale; $from_width = ($QR_width - $logo_qr_width) / 2; //重新组合图片并调整大小 imagecopyresampled($QR, $logo, $from_width, $from_width, 0, 0, $logo_qr_width,$logo_qr_height, $logo_width, $logo_height); } //输出图片 imagepng($QR,$filepath); } $list['qrcode']=$file; $tpl=":financedetail9"; //$c_type=$list['c_type']; $cid=$list['c_cid']; $showtypes=[1=>'书法','国画','油画','水彩','版画','篆刻','陶瓷','紫砂','珠宝','玉器','翡翠','织秀','雕刻','雕塑','金属工艺','漆艺','家具','文房','钱币','杂项','非遗']; $this->assign('showtypes',$showtypes); $configs=config('artbook'); $keys=array_keys($configs); $titles=array_column($configs,'title'); $parents=array_combine($keys,$titles); $parent=isset($parents[$c_type])?$parents[$c_type]:'列表'; $childs=[]; $title='艺术品溯源簿'; if($title)$this->assign('title',$title); $this->assign('parent',$parent); try { $evaluation=json_decode($list['c_evaluation'],true); if(is_string($evaluation)||empty($evaluation)){ $evaluation=json_decode(urldecode(urldecode($list['c_evaluation'])),true); } $list['c_evaluation']=$evaluation; } catch (\Exception $e) { $list['c_evaluation']=''; } } if($c_kind==1){ $this->assign('title','文化金融'); $this->assign('parent','文化产业策略联盟挂牌平台'); $tpl=":financedetail1"; } if($c_kind==2){ $this->assign('title','文化金融'); $this->assign('parent','招拍挂平台'); $tpl=":financedetail1"; } if($c_kind==3){ $tpl=":financedetail3"; $showtypes=[64=>'音乐资产托管']; $childs=[]; foreach ($showtypes as $pid=>$parent){ $rows=Db::name('type')->field('id,type_name')->where(['type_type'=>$pid,'type_status'=>1])->select(); if(count($rows)){ $ids=array_column($rows,'id'); $names=array_column($rows, 'type_name'); $childs[$pid]=array_combine($ids,$names); } } $cid=$list['c_cid']; $c_type=$list['c_type']; $title=isset($childs[$c_type][$cid])?$childs[$c_type][$cid]:''; $parent=isset($showtypes[$c_type])?$showtypes[$c_type]:''; if($title)$this->assign('title',$title); $this->assign('cid',$cid); $this->assign('c_type',$c_type); $this->assign('parent',$parent); $cshowtypes=isset($childs[$c_type])?$childs[$c_type]:[]; $this->assign('showtypes',$cshowtypes); $cates=[1=>'A担保回购式','B撮合回购式','C登记备案式']; $this->assign('showcates',$cates); $this->assign('showchilds',$childs); $this->assign('title','文化资产托管'); } if($c_kind==4){ $list["c_name"]=$this->replaceTitle($list["c_name"]); } //$list['c_content']=$this->replaceTitle($list['c_content']); $this->assign('list',$list); $this->assign('kind',$c_kind); return $this->view->fetch($tpl); } private function news($curren_menu_id='',$top_title='',$curren_title='',$news_table='',$n_id='',$n_kind='',$tpl=':news',$s_id='',$url=''){ $subid=input('s_id','','intval'); if(empty($subid)&&$s_id)$subid=$s_id; $this->assign('s_id',$subid); $this->assign('curren_menu_id',$curren_menu_id); $this->assign('top_title',$top_title); $this->assign('curren_title',$curren_title); $where=['n_status'=>1,'n_id'=>$n_id]; if($n_kind){ $where['n_kind']=$n_kind; } $cid=''; $list=Db::name($news_table)->alias('a')->join(config('database.prefix').'admin b','a.n_uid=b.admin_id')->where($where)->find(); //自行根据网站需要考虑,是否需要判断 $can_do=check_user_action($news_table.$n_id,0,false,60); if($can_do&&$list){ //更新点击数 Db::name($news_table)->update(array("n_id"=>$n_id,"n_hits"=>array("exp","n_hits+1"))); $list['n_hits']+=1; $cid=isset($list['n_cid'])?$list['n_cid']:''; } $this->assign('list',$list); $this->assign('cid',$cid); $nwhere=array("n_time"=>array("gt",$list['n_time']), "n_id"=>array('neq',$n_id),"n_status"=>1); if($n_kind){ $nwhere['n_kind']=$n_kind; } $pwhere=array("n_time"=>array("lt",$list['n_time']), "n_id"=>array('neq',$n_id),"n_status"=>1); if($n_kind){ $pwhere['n_kind']=$n_kind; } $next=Db::name($news_table)->where($nwhere)->order("n_time asc")->find(); $prev=Db::name($news_table)->where($pwhere)->order("n_time desc")->find(); $this->assign("next",$next); $this->assign("prev",$prev); //最后5篇 $lwhere=["n_status"=>1]; if($n_kind){ $lwhere['n_kind']=$n_kind; } $lists=Db::name($news_table)->where($lwhere)->order('n_order,n_time desc')->limit(5)->select(); $this->assign("lists",$lists); $this->assign('action_name',$news_table); $appId='wxd01a3ce9b62eda90'; $appSecret='a194a96bb9144cbb29c3a74635dd936c'; if(!empty($url))$link=$url; else $link=request()->url(true); $jssdk=new \weixin\Jssdk($appId, $appSecret); $signPackage = $jssdk->GetSignPackage($link); $this->assign('signPackage',$signPackage); $img=SITE_PATH.'app/home/view/szwjs/index/Public/Img/slogo.png'; $link=RemoveXSS($link); $path=request()->domain(); $share=array(); $share['title']=isset($list['n_title'])?$list['n_title']:$curren_title; $share['desc']=isset($list['n_title'])?$list['n_title']:$curren_title; $share['link']=$link; $share['imgUrl']=isset($list['n_img'])&&$list['n_img']?$path.$list['n_img']:$img; $this->assign('share',$share); return $this->view->fetch($tpl); } private function sczcxy_new($curren_menu_id,$top_title,$curren_title,$news_table,$n_id,$n_cid,$action_name='',$url) { $this->assign('s_id',''); $this->assign('curren_menu_id',$curren_menu_id); $this->assign('top_title',$top_title); $this->assign('curren_title',$curren_title); $list=Db::name($news_table)->alias('a') ->join(config('database.prefix').'admin b','a.n_uid=b.admin_id') ->where(['n_status'=>1,'n_id'=>$n_id])->find(); //自行根据网站需要考虑,是否需要判断 $can_do=check_user_action($news_table.$n_id,0,false,60); if($can_do){ //更新点击数 Db::name($news_table)->update(array("n_id"=>$n_id,"n_hits"=>array("exp","n_hits+1"))); $list['n_hits']+=1; } $this->assign('list',$list); $next=Db::name($news_table)->where(array("n_time"=>array("egt",$list['n_time']), "n_id"=>array('neq',$n_id),"n_status"=>1,"n_cid"=>$n_cid))->order("n_time asc")->find(); $prev=Db::name($news_table)->where(array("n_time"=>array("elt",$list['n_time']), "n_id"=>array('neq',$n_id),"n_status"=>1,"n_cid"=>$n_cid))->order("n_time desc")->find(); $this->assign("next",$next); $this->assign("prev",$prev); //最后5篇 $lists=Db::name($news_table)->where(["n_status"=>1,"n_cid"=>$n_cid])->order('n_order,n_time desc')->limit(5)->select(); $this->assign("lists",$lists); $this->assign('action_name',$action_name); $appId='wxd01a3ce9b62eda90'; $appSecret='a194a96bb9144cbb29c3a74635dd936c'; if(!empty($url))$link=$url; else $link=request()->url(true); $jssdk=new \weixin\Jssdk($appId, $appSecret); $signPackage = $jssdk->GetSignPackage($link); $this->assign('signPackage',$signPackage); $img=SITE_PATH.'app/home/view/szwjs/index/Public/Img/slogo.png'; if(!empty($url))$link=$url; else $link=request()->url(true); $path=request()->domain(); $share=array(); $share['title']=isset($list['n_title'])?$list['n_title']:$curren_title; $share['desc']=isset($list['n_title'])?$list['n_title']:$curren_title; $share['link']=$link; $share['imgUrl']=isset($list['n_img'])&&$list['n_img']?$path.$list['n_img']:$img; $this->assign('share',$share); return $this->view->fetch(":scnews"); } }