WxUserReportRepositories.php 1012 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace App\Http\Controllers\Api\Repositories;
  3. use App\Models\User\WxUserReport as Model;
  4. class WxUserReportRepositories
  5. {
  6. /**
  7. * Model.
  8. *
  9. * @var string
  10. */
  11. protected $eloquentClass = Model::class;
  12. /**
  13. * 举报添加数据
  14. * @param
  15. * @return bool
  16. */
  17. public static function add($uid,$type, $object_id, $report_type, $report_message, $report_imgs, $contact)
  18. {
  19. if(_empty_($contact)){
  20. $contact = '';
  21. }
  22. if(_empty_($report_message)){
  23. $report_message = '';
  24. }
  25. $feedbackModel = new Model();
  26. $feedbackModel->user_id = $uid;
  27. $feedbackModel->type = $type;
  28. $feedbackModel->object_id = $object_id;
  29. $feedbackModel->report_type = $report_type;
  30. $feedbackModel->report_message = $report_message;
  31. $feedbackModel->report_imgs = implode(',', $report_imgs);
  32. $feedbackModel->contact = $contact;
  33. return $feedbackModel->save();
  34. }
  35. }