<?php
namespace app\mainapp\controller;

use app\mainapp\BaseController;
use think\facade\Session;

use app\common\model\Sinpage as SinpageModel;

class Sinpage extends BaseController
{
	
	public function getSinpage()
	{
		$field = input('field/s');
		$sinpage = SinpageModel::where(1)->find();
		
		$data = array();
		if ($field=="aboutus"){
			$data = array(
				'pagetil' => '关于我们',
				'pagecon' => $sinpage->aboutus,
			);
		}elseif ($field=="privacy"){
			$data = array(
				'pagetil' => '隐私政策',
				'pagecon' => $sinpage->privacy,
			);
		}elseif ($field=="service"){
			$data = array(
				'pagetil' => '用户协议',
				'pagecon' => $sinpage->service,
			);
		}elseif ($field=="contact"){
			$data = array(
				'pagetil' => '联系客服',
				'pagecon' => $sinpage->contact,
			);
		}elseif ($field=="wxmp"){
            $data = array(
                'pagetil' => '嵌入公众号说明',
                'pagecon' => $sinpage->wxmp,
            );
        }else{
			$data = array(
				'pagetil' => '关于我们',
				'pagecon' => $sinpage->aboutus,
			);
		}
		
		exit(json_encode(array(
			'code' 	=> 0,
			'data'  => $data
		)));
	}
	
}