You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1000 B

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <?php
  2. declare (strict_types=1);
  3. namespace App\Model\v3;
  4. use App\Constants\v3\OssThumbnail;
  5. use App\Model\Model;
  6. use App\Service\v3\Interfaces\AttachmentServiceInterface;
  7. use Hyperf\Database\Model\SoftDeletes;
  8. use Hyperf\Di\Annotation\Inject;
  9. class ServicePersonnel extends Model
  10. {
  11. use SoftDeletes;
  12. /**
  13. * @Inject
  14. * @var AttachmentServiceInterface
  15. */
  16. protected $attachmentService;
  17. /**
  18. * The table associated with the model.
  19. *
  20. * @var string
  21. */
  22. protected $table = 'lanzu_service_personnel';
  23. /**
  24. * The attributes that are mass assignable.
  25. *
  26. * @var array
  27. */
  28. protected $fillable = [];
  29. /**
  30. * The attributes that should be cast to native types.
  31. *
  32. * @var array
  33. */
  34. // protected $casts = [
  35. // 'set_reward' => 'array'
  36. // ];
  37. public function getHeadUrlAttribute($value)
  38. {
  39. return $this->attachmentService->switchImgToAliOss($value, OssThumbnail::THUMBNAIL_600_Q90);
  40. }
  41. }