Memberconsult.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 Memberconsult extends BaseMember
  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') . '/sellerconsult.lang.php');
  18. }
  19. /**
  20. * 查询买家商品咨询
  21. */
  22. public function index()
  23. {
  24. $this->my_consult();
  25. }
  26. public function my_consult()
  27. {
  28. //实例化商品咨询模型
  29. $consult_model = model('consult');
  30. $search_array = array();
  31. if (input('param.type') != '') {
  32. if (input('param.type') == 'to_reply') {
  33. $search_array[] = array('consult_reply', '=', '');
  34. }
  35. if (input('param.type') == 'replied') {
  36. $search_array[] = array(
  37. 'consult_reply', '<>', ''
  38. );
  39. }
  40. }
  41. $search_array[] = array('member_id', '=', session('member_id'));
  42. $list_consult = $consult_model->getConsultList($search_array);
  43. View::assign('show_page', $consult_model->page_info->render());
  44. View::assign('list_consult', $list_consult);
  45. $type_v = input('param.type');
  46. $type = empty($type_v) ? 'consult_list' : $type_v;
  47. /* 设置买家当前菜单 */
  48. $this->setMemberCurMenu('member_consult');
  49. /* 设置买家当前栏目 */
  50. $this->setMemberCurItem($type);
  51. echo View::fetch($this->template_dir . 'index');
  52. exit;
  53. }
  54. /**
  55. * 用户中心右边,小导航
  56. *
  57. * @param string $menu_type 导航类型
  58. * @param string $menu_key 当前导航的menu_key
  59. * @param array $array 附加菜单
  60. * @return
  61. */
  62. public function getMemberItemList()
  63. {
  64. $menu_array = array(
  65. array(
  66. 'name' => 'consult_list',
  67. 'text' => lang('ds_member_path_all_consult'),
  68. 'url' => (string)url('Memberconsult/index')
  69. ),
  70. array(
  71. 'name' => 'to_reply',
  72. 'text' => lang('ds_member_path_unreplied_consult'),
  73. 'url' => (string)url('Memberconsult/index', ['type' => 'to_reply'])
  74. ),
  75. array(
  76. 'name' => 'replied',
  77. 'text' => lang('ds_member_path_replied_consult'),
  78. 'url' => (string)url('Memberconsult/index', ['type' => 'replied'])
  79. )
  80. );
  81. return $menu_array;
  82. }
  83. }