1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace app\index\controller;
- use think\Controller;
- use think\Db;
- class Index extends Controller
- {
- protected $noNeedLogin = '*';
- protected $noNeedRight = '*';
- protected $layout = '';
- public function index()
- {
- return $this->view->fetch();
- }
- // 新闻详情
- public function news_detail()
- {
- $id = input('id',0,'intval');
- $info = Db::name('news')->field('id,title,content,create_time')->where('id',$id)->where('status',1)->find();
- if($info){
- $info['create_time_text'] = date('Y-m-d H:i',$info['create_time']);
- }
- $this->view->assign('info', $info);
- return $this->view->fetch();
- }
- /**
- * app下载页
- * 判断是安卓还是ios
- */
- public function appdownload() {
- if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){
- header("Location: ".config('site.user_ios_download_url'));
- }else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Android')){
- $this->view->assign('downurl', config("site.user_android_download_url"));
- return $this->view->fetch();
- }else{
- $this->view->assign('downurl', config("site.user_android_download_url"));
- return $this->view->fetch();
- }
- }
- //基础文章网页
- public function basedata(){
- $key = input('key','');
- if(!$key){
- exit;
- }
- $content = Db::name('basedata')->where('key',$key)->find();
- if(!$content){
- exit;
- }
- $this->assign('content',$content['content']);
- return $this->fetch();
- }
- }
|