本文整理匯總了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.';