correcao integracao site
This commit is contained in:
@@ -22,8 +22,8 @@ class IntegrationController
|
|||||||
// Domain metrics
|
// Domain metrics
|
||||||
$blockedDomains = $domainModel->countBlocked();
|
$blockedDomains = $domainModel->countBlocked();
|
||||||
|
|
||||||
// Last Update - Try specific key first, fallback to now if not set yet
|
// Last Update - Date of last order
|
||||||
$lastUpdate = $settingModel->get('last_rpz_update');
|
$lastUpdate = $orderModel->getLastOrderDate();
|
||||||
if (!$lastUpdate) {
|
if (!$lastUpdate) {
|
||||||
$lastUpdate = date('Y-m-d H:i:s');
|
$lastUpdate = date('Y-m-d H:i:s');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,4 +26,11 @@ class Order extends Model
|
|||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
return $stmt->fetch()['total'];
|
return $stmt->fetch()['total'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getLastOrderDate()
|
||||||
|
{
|
||||||
|
$stmt = $this->conn->query("SELECT created_at FROM orders ORDER BY id DESC LIMIT 1");
|
||||||
|
$result = $stmt->fetch();
|
||||||
|
return $result ? $result['created_at'] : null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user