<?php
$wid = Session::get("wid");
$domain=$_SERVER['HTTP_HOST'];
$agency=new Model('user_agency');	
$agency->find(array('domain'=>$domain));
$key_word=$agency->key_word;//网站关键词
$describe=$agency->describe;//网站描述
$email=$agency->email;//email
$phone=$agency->telephone;//联系电话
$qq=$agency->kfcode;//QQ
$logo=$agency->logo;//logo
$webname=$agency->webname;//网站名称
$webtitle=$agency->webtitle;//网站标题
$company_name=$agency->company_name;//公司名称
$company_address=$agency->company_address;//公司地址
$record_number=$agency->record_number;//备案号
$qr_code=$agency->qr_code;//二维码
$menuManage = (new Model('pc_menu_manage'))->find(['pid'=>$agency->id]);
$menu = json_decode($menuManage->menu,1);
$slideManage = (new Model('pc_slide_manage'))->where(['pid'=>$agency->id])->order('sort')->list_all();
if(!count($slideManage) && !$agency->isadmin){
	$admin = (new Model('user_agency'))->find(['isadmin'=>1]);
	$slideManage = (new Model('pc_slide_manage'))->where(['pid'=>$admin->id])->order('sort')->list_all();
}
$lxkefu = (new Model('qy_kefu'))->find(['mid' => $agency->id]);
$switch=$agency->switch_pc;
if($switch==1){
Page::view('moban/index');
}else{
Redirect::to('/login');	
}
