UserService.php 704 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Services;
  3. use App\Http\Params\ProblemParam;
  4. use App\Models\UserProblemModel;
  5. use PHPUnit\Util\Exception;
  6. class UserService
  7. {
  8. /**
  9. * 问题反馈
  10. */
  11. public function problem(ProblemParam $param){
  12. if(empty($param->content)){
  13. throw new Exception("请输入问题");
  14. }
  15. $ins = array();
  16. $ins['user_id'] = $param->user_id;
  17. $ins['content'] = htmlspecialchars($param->content);
  18. $ins['img_url'] = $param->img_url;
  19. $ins['status'] = $param->status;
  20. UserProblemModel::query()->create($ins);
  21. return true;
  22. }
  23. /**
  24. * 看过我
  25. */
  26. public function looked_me($param){
  27. }
  28. }