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