Memberconsult.php 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. namespace app\home\controller;
  3. use think\facade\View;
  4. use think\facade\Lang;
  5. /**
  6. * ============================================================================
  7. *
  8. * ============================================================================
  9. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  10. * 网站地址: https://www.valimart.net/
  11. * ----------------------------------------------------------------------------
  12. *
  13. * ============================================================================
  14. * 控制器
  15. */
  16. class Memberconsult extends BaseMember
  17. {
  18. public function initialize()
  19. {
  20. parent::initialize(); // TODO: Change the autogenerated stub
  21. Lang::load(base_path() . 'home/lang/'.config('lang.default_lang').'/sellerconsult.lang.php');
  22. }
  23. /**
  24. * 查询买家商品咨询
  25. */
  26. public function index()
  27. {
  28. $this->my_consult();
  29. }
  30. public function my_consult()
  31. {
  32. //实例化商品咨询模型
  33. $consult_model = model('consult');
  34. $search_array = array();
  35. if (input('param.type') != '') {
  36. if (input('param.type') == 'to_reply') {
  37. $search_array[]=array('consult_reply','=','');
  38. }
  39. if (input('param.type') == 'replied') {
  40. $search_array[] = array('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');exit;
  55. }
  56. /**
  57. * 用户中心右边,小导航
  58. *
  59. * @param string $menu_type 导航类型
  60. * @param string $menu_key 当前导航的menu_key
  61. * @param array $array 附加菜单
  62. * @return
  63. */
  64. public function getMemberItemList()
  65. {
  66. $menu_array = array(
  67. array(
  68. 'name' => 'consult_list',
  69. 'text' => lang('ds_member_path_all_consult'),
  70. 'url' => (string)url('Memberconsult/index')
  71. ),
  72. array(
  73. 'name' => 'to_reply',
  74. 'text' => lang('ds_member_path_unreplied_consult'),
  75. 'url' => (string)url('Memberconsult/index',['type'=>'to_reply'])
  76. ),
  77. array(
  78. 'name' => 'replied',
  79. 'text' => lang('ds_member_path_replied_consult'),
  80. 'url' => (string)url('Memberconsult/index',['type'=>'replied'])
  81. )
  82. );
  83. return $menu_array;
  84. }
  85. }