Trouble.php 534 B

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