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