diff --git a/Admin/Installer.php b/Admin/Installer.php index 3212a46..340d4ef 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -133,8 +133,8 @@ class Installer extends InstallerAbstract `account_password` varchar(64) NOT NULL, `account_email` varchar(70) NOT NULL, `account_tries` tinyint(2) NOT NULL DEFAULT 0, - `account_lactive` datetime NOT NULL, - `account_created` datetime NOT NULL, + `account_lactive` datetime DEFAULT NULL, + `account_created_at` datetime NOT NULL, PRIMARY KEY (`account_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;' )->execute(); diff --git a/Controller.php b/Controller.php index 2bab1b4..46a2e2c 100644 --- a/Controller.php +++ b/Controller.php @@ -17,8 +17,6 @@ namespace Modules\Admin; use Modules\Admin\Models\AccountMapper; use Modules\Admin\Models\GroupMapper; -use Modules\Navigation\Models\Navigation; -use Modules\Navigation\Views\NavigationView; use phpOMS\Contract\RenderableInterface; use phpOMS\Message\RequestAbstract; use phpOMS\Message\RequestDestination; diff --git a/Models/Account.php b/Models/Account.php index 324d727..c8ae20f 100644 --- a/Models/Account.php +++ b/Models/Account.php @@ -17,10 +17,4 @@ namespace Modules\Admin\Models; class Account extends \phpOMS\Account\Account { - protected $createdAt = null; - - public function getCreatedAt() : \DateTime - { - return $this->createdAt ?? new \DateTime('NOW'); - } } diff --git a/Models/AccountMapper.php b/Models/AccountMapper.php index c523325..794231b 100644 --- a/Models/AccountMapper.php +++ b/Models/AccountMapper.php @@ -27,19 +27,19 @@ class AccountMapper extends DataMapperAbstract * @since 1.0.0 */ protected static $columns = [ - 'account_id' => ['name' => 'account_id', 'type' => 'int', 'internal' => 'id'], - 'account_status' => ['name' => 'account_status', 'type' => 'int', 'internal' => 'status'], - 'account_type' => ['name' => 'account_type', 'type' => 'int', 'internal' => 'type'], + 'account_id' => ['name' => 'account_id', 'type' => 'int', 'internal' => 'id'], + 'account_status' => ['name' => 'account_status', 'type' => 'int', 'internal' => 'status'], + 'account_type' => ['name' => 'account_type', 'type' => 'int', 'internal' => 'type'], 'account_login' => ['name' => 'account_login', 'type' => 'string', 'internal' => 'login'], - 'account_name1' => ['name' => 'account_name1', 'type' => 'string', 'internal' => 'name1'], - 'account_name2' => ['name' => 'account_name2', 'type' => 'string', 'internal' => 'name2'], - 'account_name3' => ['name' => 'account_name3', 'type' => 'string', 'internal' => 'name3'], + 'account_name1' => ['name' => 'account_name1', 'type' => 'string', 'internal' => 'name1'], + 'account_name2' => ['name' => 'account_name2', 'type' => 'string', 'internal' => 'name2'], + 'account_name3' => ['name' => 'account_name3', 'type' => 'string', 'internal' => 'name3'], 'account_password' => ['name' => 'account_password', 'type' => 'string', 'internal' => 'password'], - 'account_email' => ['name' => 'account_email', 'type' => 'string', 'internal' => 'email'], - 'account_tries' => ['name' => 'account_tries', 'type' => 'int', 'internal' => 'tries'], - 'account_lactive' => ['name' => 'account_lactive', 'type' => 'DateTime', - 'internal' => 'lastActive'], - 'account_created' => ['name' => 'account_created', 'type' => 'int', 'internal' => 'created'], + 'account_email' => ['name' => 'account_email', 'type' => 'string', 'internal' => 'email'], + //'account_tries' => ['name' => 'account_tries', 'type' => 'int', 'internal' => 'tries'], + 'account_lactive' => ['name' => 'account_lactive', 'type' => 'DateTime', + 'internal' => 'lastActive'], + 'account_created_at' => ['name' => 'account_created_at', 'type' => 'DateTime', 'internal' => 'createdAt'], ]; /** @@ -64,5 +64,5 @@ class AccountMapper extends DataMapperAbstract * @var string * @since 1.0.0 */ - protected static $createdAt = 'account_created'; + protected static $createdAt = 'account_created_at'; }