Config.php 882 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Builder;
  4. use Illuminate\Database\Eloquent\Model;
  5. /**
  6. * @mixin Builder
  7. * @method static Builder|static where($column, $operator = null, $value = null, $boolean = 'and')
  8. */
  9. class Config extends Model
  10. {
  11. protected $table = 'config';
  12. protected $hidden = ['created_at', 'updated_at'];
  13. protected $fillable = ['field', 'val', 'remark','group_id'];
  14. /*
  15. * group_id
  16. * 1 系统基础配置
  17. * 2 频道消息配置
  18. * 3 用户自定义配置
  19. *
  20. *
  21. */
  22. protected function getCreatedAtAttribute($value)
  23. {
  24. return \Carbon\Carbon::parse($value)->setTimezone('Asia/Shanghai')->format('Y-m-d H:i:s');
  25. }
  26. protected function getUpdatedAtAttribute($value)
  27. {
  28. return \Carbon\Carbon::parse($value)->setTimezone('Asia/Shanghai')->format('Y-m-d H:i:s');
  29. }
  30. }