Memberfeedback.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace app\api\controller;
  3. /**
  4. * ============================================================================
  5. * DSMall多用户商城
  6. * ============================================================================
  7. * 版权所有 2014-2028 长沙德尚网络科技有限公司,并保留所有权利。
  8. * 网站地址: http://www.csdeshang.com
  9. * ----------------------------------------------------------------------------
  10. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
  11. * 不允许对程序代码以任何形式任何目的的再发布。
  12. * ============================================================================
  13. * 用户反馈控制器
  14. */
  15. class Memberfeedback extends MobileMember
  16. {
  17. public function initialize()
  18. {
  19. parent::initialize();
  20. }
  21. /**
  22. * 反馈列表
  23. */
  24. public function feedback_list()
  25. {
  26. $feedback_model = model('feedback');
  27. $condition = array(
  28. 'member_id' => $this->member_info['member_id']
  29. );
  30. $feedback_list = $feedback_model->getFeedbackList($condition);
  31. $result = array_merge(array('feedback_list' => $feedback_list), mobile_page($feedback_model->page_info));
  32. ds_json_encode(10000, '', $result);
  33. }
  34. /**
  35. * 添加反馈
  36. */
  37. public function feedback_add()
  38. {
  39. $feedback_model = model('feedback');
  40. $param = array();
  41. $param['fb_content'] = input('post.feedback');
  42. $param['fb_type'] = 1;
  43. $param['fb_time'] = TIMESTAMP;
  44. $param['member_id'] = $this->member_info['member_id'];
  45. $param['member_name'] = $this->member_info['member_name'];
  46. $res=word_filter($param['fb_content']);
  47. if(!$res['code']){
  48. ds_json_encode(10001,$res['msg']);
  49. }
  50. $param['fb_content']=$res['data']['text'];
  51. $result = $feedback_model->addFeedback($param);
  52. if ($result) {
  53. ds_json_encode(10000, lang('ds_common_op_succ'), 1);
  54. } else {
  55. ds_json_encode(10001, lang('ds_common_op_fail'));
  56. }
  57. }
  58. }