Memberfeedback.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace app\api\controller;
  3. /**
  4. * ============================================================================
  5. *
  6. * ============================================================================
  7. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  8. * 网站地址: https://www.valimart.net/
  9. * ----------------------------------------------------------------------------
  10. *
  11. * ============================================================================
  12. * 用户反馈控制器
  13. */
  14. class Memberfeedback extends MobileMember
  15. {
  16. public function initialize()
  17. {
  18. parent::initialize();
  19. }
  20. /**
  21. * 反馈列表
  22. */
  23. public function feedback_list()
  24. {
  25. $feedback_model = model('feedback');
  26. $condition = array(
  27. 'member_id' => $this->member_info['member_id']
  28. );
  29. $feedback_list = $feedback_model->getFeedbackList($condition);
  30. $result = array_merge(array('feedback_list' => $feedback_list), mobile_page($feedback_model->page_info));
  31. ds_json_encode(10000, '', $result);
  32. }
  33. /**
  34. * 添加反馈
  35. */
  36. public function feedback_add()
  37. {
  38. $feedback_model = model('feedback');
  39. $param = array();
  40. $param['fb_content'] = input('post.feedback');
  41. $param['fb_type'] = 1;
  42. $param['fb_time'] = TIMESTAMP;
  43. $param['member_id'] = $this->member_info['member_id'];
  44. $param['member_name'] = $this->member_info['member_name'];
  45. $res=word_filter($param['fb_content']);
  46. if(!$res['code']){
  47. ds_json_encode(10001,$res['msg']);
  48. }
  49. $param['fb_content']=$res['data']['text'];
  50. $result = $feedback_model->addFeedback($param);
  51. if ($result) {
  52. ds_json_encode(10000, lang('ds_common_op_succ'), 1);
  53. } else {
  54. ds_json_encode(10001, lang('ds_common_op_fail'));
  55. }
  56. }
  57. }