Draft.php 639 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App\Model;
  3. use Illuminate\Database\Eloquent\Model;
  4. //草稿
  5. class Draft extends DataScopeBaseModel
  6. {
  7. protected $guarded = [];
  8. protected $table = "draft"; //指定表
  9. const CREATED_AT = 'crt_time';
  10. const UPDATED_AT = 'upd_time';
  11. protected $dateFormat = 'U';
  12. public static $field = ['id', 'type', 'document_id', 'crt_id', 'crt_time', 'upd_time'];
  13. /**
  14. * 属性转换为原生类型
  15. */
  16. protected $casts = [
  17. 'content' => 'array', // 声明 content 字段读取时自动转为数组
  18. 'opt_user' => 'array', // 声明 content 字段读取时自动转为数组
  19. ];
  20. }