32 lines
726 B
PHP
32 lines
726 B
PHP
<?php
|
|
|
|
namespace app\models;
|
|
|
|
/**
|
|
* Class History
|
|
* @package app\models
|
|
* @property int $action
|
|
* @property string $user
|
|
* @property string $table_name
|
|
* @property int $history_id
|
|
* @property string $date_time
|
|
* @property string $date
|
|
*/
|
|
class History extends _Base
|
|
{
|
|
public static function addNew($id, $table, $user, $edit = false)
|
|
{
|
|
$history = new History();
|
|
$history->history_id = $id;
|
|
$history->action = $edit == true ? 2 : 1;
|
|
$history->table_name = $table;
|
|
$history->user = $user;
|
|
$history->date_time = date('Y-m-d H:i:s');
|
|
$history->save();
|
|
}
|
|
|
|
public function getDate() {
|
|
return date('d.m.Y', strtotime($this->date_time));
|
|
}
|
|
}
|