SystemLog.php 500 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace app\common\model;
  3. use app\common\model\TimeModel;
  4. class SystemLog extends TimeModel
  5. {
  6. public function __construct(array $data = [])
  7. {
  8. parent::__construct($data);
  9. $this->name = 'system_log_' . date('Ym');
  10. }
  11. public function setMonth($month)
  12. {
  13. $this->name = 'system_log_' . $month;
  14. return $this;
  15. }
  16. public function admin()
  17. {
  18. return $this->belongsTo('app\common\model\SystemAdmin', 'admin_id', 'id');
  19. }
  20. }