Shophelp.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * Niushop商城系统 - 团队十年电商经验汇集巨献!
  4. * =========================================================
  5. * Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
  6. * ----------------------------------------------
  7. * 官方网址: https://www.niushop.com
  8. * =========================================================
  9. */
  10. namespace app\shop\controller;
  11. use app\model\web\Help as HelpModel;
  12. /**
  13. * 商家帮助
  14. */
  15. class Shophelp extends BaseShop
  16. {
  17. /**
  18. * 帮助列表
  19. */
  20. public function helpList()
  21. {
  22. $help_model = new HelpModel();
  23. if (request()->isAjax()) {
  24. $page = input('page', 1);
  25. $page_size = input('page_size', PAGE_LIST_ROWS);
  26. $search_text = input('search_text', '');
  27. $class_id = input('class_id', '');
  28. $condition = [
  29. [ 'app_module', '=', 'shop' ]
  30. ];
  31. if (!empty($class_id)) {
  32. $condition[] = [ 'class_id', '=', $class_id ];
  33. }
  34. $condition[] = [ 'title', 'like', '%' . $search_text . '%' ];
  35. $order = 'create_time desc';
  36. $field = 'id,title,class_id,class_name,sort,create_time';
  37. return $help_model->getHelpPageList($condition, $page, $page_size, $order, $field);
  38. } else {
  39. $class_list = $help_model->getHelpClassList();
  40. $this->assign("class_list", $class_list);
  41. $this->assign('menu_info', [ 'title' => '商家帮助' ]);
  42. return $this->fetch('shophelp/help_list');
  43. }
  44. }
  45. /**
  46. * 帮助列表
  47. */
  48. public function helpDetail()
  49. {
  50. $help_id = input('help_id', 1);
  51. $help_model = new HelpModel();
  52. $help_info = $help_model->getHelpInfo($help_id);
  53. $this->assign("help_info", $help_info[ 'data' ]);
  54. $this->assign('menu_info', [ 'title' => $help_info[ 'data' ][ 'title' ] ]);
  55. return $this->fetch('shophelp/help_detail');
  56. }
  57. }