SysLog.php 539 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\model;
  3. use DateTimeInterface;
  4. use support\Model;
  5. class SysLog extends Model
  6. {
  7. protected $table = 'sys_log';
  8. protected $primaryKey = 'log_id';
  9. protected $dateFormat = 'U';
  10. const CREATED_AT = 'log_create_time';
  11. const UPDATED_AT = null;
  12. protected function serializeDate(DateTimeInterface $date)
  13. {
  14. return $date->format('Y-m-d H:i:s');
  15. }
  16. public function user(){
  17. return $this->hasOne(SysUser::class,'user_id','log_admin_id')->select('user_id','user_name');
  18. }
  19. }