MovieBlame.php 762 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace App\Models\Movie;
  3. use Illuminate\Database\Eloquent\Model;
  4. use App\Http\Traits\PagingTrait;
  5. class MovieBlame extends Model
  6. {
  7. use PagingTrait;
  8. protected $table = 'tb_movie_blame';
  9. protected $primaryKey = 'id';
  10. public $keyType = 'int';
  11. public $incrementing = true;
  12. public $timestamps = true;
  13. const CREATED_AT = 'created_at';
  14. const UPDATED_AT = 'updated_at';
  15. const DELETED_AT = null;
  16. protected $guarded = [];
  17. /**
  18. * 신고 등록했는지
  19. */
  20. public function isAlready(string $movieCd, int $reviewID, int $userID): bool
  21. {
  22. return $this->where([
  23. ['id', $reviewID],
  24. ['movie_cd', $movieCd],
  25. ['user_id', $userID]
  26. ])->exists();
  27. }
  28. }