Files
EasyAdmin8/app/admin/model/SystemLog.php
2023-08-01 01:32:35 +08:00

30 lines
590 B
PHP

<?php
namespace app\admin\model;
use app\admin\service\SystemLogService;
use app\common\model\TimeModel;
class SystemLog extends TimeModel
{
public function __construct(array $data = [])
{
parent::__construct($data);
$this->name = 'system_log_' . date('Ym');
}
public function setMonth($month)
{
SystemLogService::instance()->detectTable();
$this->name = 'system_log_' . $month;
return $this;
}
public function admin()
{
return $this->belongsTo('app\admin\model\SystemAdmin', 'admin_id', 'id');
}
}