Category.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace app\home\controller;
  3. use think\facade\View;
  4. use think\facade\Lang;
  5. /**
  6. * ============================================================================
  7. *
  8. * ============================================================================
  9. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  10. * 网站地址: https://www.valimart.net/
  11. * ----------------------------------------------------------------------------
  12. *
  13. * ============================================================================
  14. * 控制器
  15. */
  16. class Category extends BaseMall {
  17. public function initialize() {
  18. parent::initialize();
  19. Lang::load(base_path() . 'home/lang/'.config('lang.default_lang').'/category.lang.php');
  20. }
  21. /*
  22. * 显示商品分类列表
  23. */
  24. public function goods() {
  25. //获取全部的商品分类
  26. //导航
  27. $nav_link = array(
  28. '0' => array('title' => lang('homepage'), 'link' => HOME_SITE_URL),
  29. '1' => array('title' => lang('category_index_goods_class'))
  30. );
  31. View::assign('nav_link_list', $nav_link);
  32. View::assign('html_title', config('ds_config.site_name') . ' - ' . lang('category_index_goods_class'));
  33. return View::fetch($this->template_dir . 'goods_category');
  34. }
  35. /*
  36. * 显示店铺分类列表
  37. */
  38. public function store() {
  39. //导航
  40. $nav_link = array(
  41. '0' => array('title' => lang('homepage'), 'link' => HOME_SITE_URL),
  42. '1' => array('title' => lang('category_index_store_class'))
  43. );
  44. View::assign('nav_link_list', $nav_link);
  45. $sc_list = model('storeclass')->getStoreclassList();
  46. View::assign('sc_list', $sc_list);
  47. return View::fetch($this->template_dir . 'store_category');
  48. }
  49. }