FileImg.php 593 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace App\Module\File\Models;
  3. use App\Module\File\Img;
  4. use UCore\ModelCore;
  5. use Illuminate\Database\Eloquent\SoftDeletes;
  6. /**
  7. * 图片文件
  8. *
  9. * field start
  10. * field end
  11. *
  12. */
  13. class FileImg extends \UCore\ModelCore
  14. {
  15. use SoftDeletes;
  16. // attrlist start
  17. protected $fillable = [
  18. ];
  19. // attrlist end
  20. protected $table = 'file_imgs';
  21. protected $appends =[
  22. 'url'
  23. ];
  24. public function getUrlAttribute()
  25. {
  26. return $this->getUrl();
  27. }
  28. public function getUrl()
  29. {
  30. return Img::getAdminPicUrl($this->path);
  31. }
  32. }