About.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. * 关于我们等页面 控制器
  4. * Created by PhpStorm.
  5. * User: Administrator
  6. * Date: 2019/9/29
  7. * Time: 14:11
  8. */
  9. namespace app\mobile\controller;
  10. use think\Request;
  11. class About extends Mobile
  12. {
  13. /**
  14. * 初始化操作
  15. */
  16. protected function _initialize()
  17. {
  18. parent::_initialize();
  19. // 获取底部关于我们列表
  20. $aboutList = model('Aboutus')->getAboutList();
  21. $this->assign('aboutList',$aboutList);
  22. }
  23. public function _empty()
  24. {
  25. $action = Request::instance()->action();
  26. $info = $this->getAboutData($action);
  27. $this->assign('info',$info);
  28. return $this->fetch('about/index');
  29. }
  30. /**
  31. * 关于 的页面加载
  32. */
  33. private function getAboutData($action) {
  34. $info = model('Aboutus')->where('name',$action)->find();
  35. if (empty($info)) $this->error('暂无数据');
  36. return $info;
  37. }
  38. /**
  39. * 服务协议
  40. */
  41. public function agreement(){
  42. return $this->fetch();
  43. }
  44. }