Trouble.php 573 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class Trouble extends Model
  5. {
  6. protected $guarded = [];
  7. protected $casts = [
  8. 'trouble_imgs' => 'array'
  9. ];
  10. const STATUS_OK = 1;
  11. const STATUS_PAUSE = 0;
  12. public static $statusMaps = [
  13. self::STATUS_OK => '正常',
  14. self::STATUS_PAUSE => '暂停'
  15. ];
  16. const UP_TYPE_COMMON = 0;
  17. public static $UpTypeMaps = [
  18. self::UP_TYPE_COMMON => '普通',
  19. ];
  20. public function images()
  21. {
  22. return $this->hasMany(Upload::class);
  23. }
  24. }