Add methods to retrieve and analyze product sales data, send department statistics to Slack, and implement scheduled messaging logic
This commit is contained in:
@@ -22,6 +22,17 @@ class db
|
||||
$this->database = $config['database'];
|
||||
}
|
||||
|
||||
public static function getPDO(): \PDO
|
||||
{
|
||||
global $config;
|
||||
$dsn = "mysql:host={$config['db']['host']};dbname={$config['db']['database']};charset=utf8mb4";
|
||||
return new \PDO($dsn, $config['db']['user'], $config['db']['password'], [
|
||||
\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,
|
||||
\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
|
||||
\PDO::ATTR_EMULATE_PREPARES => false,
|
||||
]);
|
||||
}
|
||||
|
||||
public function connect(): void
|
||||
{
|
||||
global $response;
|
||||
|
||||
Reference in New Issue
Block a user