init
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
class AdvLoggerService
|
||||
{
|
||||
protected $db, $currentDate, $tableName;
|
||||
public function __construct()
|
||||
{
|
||||
$this->db = \Config\Database::connect();
|
||||
}
|
||||
|
||||
public function insertLog($data)
|
||||
{
|
||||
$this->db->table('adv_change_logs')->insert($data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
class LoggerService
|
||||
{
|
||||
protected $db, $currentDate, $tableName;
|
||||
public function __construct()
|
||||
{
|
||||
$this->db = \Config\Database::connect();
|
||||
$this->currentDate = date('Ym');
|
||||
$this->tableName = 'zenith_logs_'.$this->currentDate;
|
||||
}
|
||||
|
||||
public function insertLog($data)
|
||||
{
|
||||
$this->db->table($this->tableName)->insert($data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user