You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

54 lines
1.6 KiB

  1. <?php
  2. /**
  3. *
  4. * ============================================================================
  5. * * 版权所有 蜘蛛出行 * *
  6. * 网站地址: http://www.zhizhuchuxing.com
  7. * ----------------------------------------------------------------------------
  8. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
  9. * 使用;不允许对程序代码以任何形式任何目的的再发布。
  10. * ============================================================================
  11. * Author By: 倪宗锋
  12. * PhpStorm SuggestController.php
  13. * Create By 2016/11/29 13:45 $
  14. */
  15. namespace WeChatUser\Controller;
  16. use Base\Tool\LoginTool;
  17. use Util\Controller\MvcController;
  18. use WeChatUser\Service\SuggestService;
  19. class SuggestController extends MvcController
  20. {
  21. private $service = null;
  22. private function getService()
  23. {
  24. if ($this->service == null) {
  25. $this->service = new SuggestService();
  26. }
  27. return $this->service;
  28. }
  29. /**
  30. * Function Description:意见反馈提交
  31. * Function Name: indexAction
  32. *
  33. * @return string
  34. *
  35. * @author 倪宗锋
  36. */
  37. public function indexAction()
  38. {
  39. LoginTool::checkLogin();//此处校验只是用于获取用户ID
  40. $params = array(
  41. 'content' =>htmlspecialchars(urldecode($this->_post('content', ''))) ,//评论内容双转义
  42. 'uid' => LoginTool::$userId ? LoginTool::$userId : 0//用户ID 可能为空
  43. );
  44. $result = $this->getService()->addSuggest($params);//添加用户建议反馈
  45. return json_encode($result);
  46. }
  47. }