Showhelp.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace app\home\controller;
  3. use think\facade\View;
  4. use think\facade\Lang;
  5. /**
  6. *
  7. *
  8. * ----------------------------------------------------------------------------
  9. *
  10. * 控制器
  11. */
  12. class Showhelp extends BaseMall
  13. {
  14. public function initialize()
  15. {
  16. parent::initialize(); // TODO: Change the autogenerated stub
  17. Lang::load(base_path() . 'home/lang/' . config('lang.default_lang') . '/showhelp.lang.php');
  18. }
  19. /**
  20. * 店铺帮助页
  21. *
  22. */
  23. public function index()
  24. {
  25. $help_model = model('help');
  26. $help_list = $help_model->getShowStoreHelpList();
  27. $helptype_id = intval(input('param.t_id')); //帮助类型编号
  28. if ($helptype_id < 1 || empty($help_list[$helptype_id])) {
  29. $type_array = current($help_list);
  30. $helptype_id = $type_array['helptype_id'];
  31. }
  32. View::assign('helptype_id', $helptype_id);
  33. $help_id = intval(input('param.help_id')); //帮助编号
  34. if ($help_id < 1 || empty($help_list[$helptype_id]['help_list'][$help_id])) {
  35. $help = @current($help_list[$helptype_id]['help_list']);
  36. $help_id = $help['help_id'];
  37. } else {
  38. $help = $help_list[$helptype_id]['help_list'][$help_id];
  39. }
  40. View::assign('help_id', $help_id);
  41. View::assign('help_list', $help_list); //左侧帮助类型及帮助
  42. View::assign('help', $help); //当前帮助
  43. View::assign('article_list', ''); //底部不显示首页的文章分类
  44. $phone_array = explode(',', config('ds_config.site_phone'));
  45. View::assign('phone_array', $phone_array);
  46. View::assign('html_title', config('ds_config.site_name') . ' - ' . lang('business_management_center'));
  47. return View::fetch($this->template_dir . 'store_help');
  48. }
  49. }