About.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. namespace app\home\controller;
  3. use think\Lang;
  4. use think\Cache;
  5. use think\Request;
  6. use think\Controller;
  7. use think\Validate;
  8. /**
  9. * 关于我们类
  10. */
  11. class About extends Controller
  12. {
  13. /**
  14. * 构造函数
  15. *
  16. * @access public
  17. */
  18. public function __construct()
  19. {
  20. parent::__construct();
  21. }//end __construct()
  22. /**
  23. * 关于我们管理
  24. *
  25. * @access public
  26. * @return array JsonString
  27. */
  28. public function index()
  29. {
  30. // 获取导航.
  31. $navigationField = [
  32. 'navigation_zhName',
  33. 'navigation_enName',
  34. 'navigation_id',
  35. ];
  36. $navigationWhere = ['navigation_type' => 1];
  37. $getNavigation = model('Navigation')->getSelect($navigationField, $navigationWhere);
  38. $this->assign('navigation', $getNavigation);
  39. // 导航Id.
  40. $navigationId = [
  41. 'home',
  42. 'service',
  43. 'count',
  44. 'about-us',
  45. 'contact',
  46. 'pricing',
  47. ];
  48. $this->assign('navigationId', $navigationId);
  49. // 获取未显示在导航的标题.
  50. $navigationWhere = ['navigation_type' => 2];
  51. $getNavigation = model('Navigation')->getSelect($navigationField, $navigationWhere);
  52. $this->assign('navigationTitle', $getNavigation);
  53. // 获取文字内容.
  54. $getAboutSlt = [
  55. 'product_title',
  56. 'product_ctitle',
  57. ];
  58. $getAboutWhr['product_type'] = 6;
  59. $getAbout = model('Product')->getSelect($getAboutSlt, $getAboutWhr);
  60. $this->assign('about', $getAbout);
  61. // 获取foot.
  62. $getFootSlt = [
  63. 'value',
  64. 'remark',
  65. ];
  66. $getFootWhr = [
  67. ['code' => 'site_phone'],
  68. ['code' => 'site_email'],
  69. ['code' => 'fax'],
  70. ];
  71. $getFoot = model('Config')->getSelect($getFootSlt, $getFootWhr);
  72. $this->assign('foot', $getFoot);
  73. return $this->fetch();
  74. }//end index()
  75. }