PartnerBeauty.php 726 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace App\Models\Partner;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Database\Eloquent\SoftDeletes;
  5. class PartnerBeauty extends Model
  6. {
  7. use SoftDeletes;
  8. protected $table = "partner_beauties";
  9. protected $dateFormat = "U";
  10. protected $fillable = [
  11. 'partner_id',
  12. 'uid',
  13. 'sex',
  14. 'field',
  15. 'original_photo',
  16. 'new_photo',
  17. 'is_beauty',
  18. 'submitted_at'
  19. ];
  20. protected $appends = [
  21. 'is_submit'
  22. ];
  23. protected $casts = [
  24. 'is_submit' => 'boolean',
  25. 'is_beauty' => 'boolean',
  26. ];
  27. public function getIsSummitAttribute()
  28. {
  29. return $this->submitted_at ? true : false;
  30. }
  31. }