本文整理汇总了PHP中SqlQuery::mysqlTimestamp方法的典型用法代码示例。如果您正苦于以下问题:PHP SqlQuery::mysqlTimestamp方法的具体用法?PHP SqlQuery::mysqlTimestamp怎么用?PHP SqlQuery::mysqlTimestamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SqlQuery
的用法示例。
在下文中一共展示了SqlQuery::mysqlTimestamp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateLastAccess
public function updateLastAccess()
{
if ($this->isAuth()) {
$customer = new Customer($this->db);
$customer->data['customer_id'] = $this->customer->val('customer_id');
$customer->data['customer_last_access'] = SqlQuery::mysqlTimestamp(time());
$customer->save();
}
}
示例2: Customer
<?php
require_once $home_dir . 'models/customer.m.php';
require_once $home_dir . 'models/custsess.m.php';
$sessions = CustomerSession::Select($db, 'customer_sessions', 'customer_session_expires <= ?', [SqlQuery::mysqlTimestamp(time())], 's', null, null);
foreach ($sessions as $session) {
$customer = new Customer($db, $session->val('customer_session_customer_id'));
$session->deleteById();
if ($customer->val('customer_anonymous')) {
$customer->deleteById();
}
}
echo 'Sessions cleared.';