Memberfeedback.php 1.6 KB

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