12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- /**
- * cms首页
- *
- *
- *
- */
- //use Shopnc\Tpl;
- defined('InShopNC') or exit('Access Invalid!');
- class indexControl extends mobileHomeControl{
- public function __construct() {
- parent::__construct();
- }
- /**
- * 首页
- */
- public function indexOp() {
- $model_mb_special = Model('mb_special');
- $data = $model_mb_special->getMbSpecialIndex();
- var_dump($data);
-
- $this->_output_special($data, $_GET['type']);
- }
- /**
- * 专题
- */
- public function specialOp() {
- $model_mb_special = Model('mb_special');
- $data = $model_mb_special->getMbSpecialItemUsableListByID($_GET['special_id']);
- $this->_output_special($data, $_GET['type'], $_GET['special_id']);
- }
- /**
- * 输出专题
- */
- private function _output_special($data, $type = 'json', $special_id = 0)
- {
- $model_special = Model('mb_special');
- if($_GET['type'] == 'html')
- {
- $html_path = $model_special->getMbSpecialHtmlPath($special_id);
- if(!is_file($html_path)) {
- ob_start();
- Tpl::output('list', $data);
- Tpl::showpage('mb_special');
- file_put_contents($html_path, ob_get_clean());
- }
- header('Location: ' . $model_special->getMbSpecialHtmlUrl($special_id));
- //die;
- }
- else
- {
- if(empty($data)) {
- $data=array();
- }
- //$data['site_mobile_logo']=array(C('site_mobile_logo'));
- //print_r($data);
- output_data($data);
- }
- }
- /**
- * android客户端版本号
- */
- public function apk_versionOp() {
- $version = C('mobile_apk_version');
- $url = C('mobile_apk');
- if(empty($version)) {
- $version = '';
- }
- if(empty($url)) {
- $url = '';
- }
- output_data(array('version' => $version, 'url' => $url));
- }
- }
|