Information.php 948 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * @package merchant
  4. *
  5. * @author xaboy<xaboy2005@qq.com>
  6. * @day 2020/5/28
  7. *
  8. *
  9. */
  10. namespace app\controller\api\user;
  11. use crmeb\basic\BaseController;
  12. // use app\common\repositories\user\FeedbackRepository;
  13. use app\validate\api\InformationValidate;
  14. use think\App;
  15. class Information extends BaseController
  16. {
  17. protected $repository;
  18. public function __construct(App $app, FeedbackRepository $repository)
  19. {
  20. parent::__construct($app);
  21. // $this->repository = $repository;
  22. }
  23. /**
  24. * @return mixed
  25. * @author xaboy
  26. * @day 2020/5/28
  27. */
  28. public function postinfo(FeedbackValidate $validate)
  29. {
  30. $data = $this->request->params(['type', 'content', ['images', []], 'realname', 'contact']);
  31. $validate->check($data);
  32. $data['uid'] = $this->request->uid();
  33. $this->repository->create($data);
  34. return app('json')->success('反馈成功');
  35. }
  36. }