Initial Ladill Queue release — enterprise QMS standalone app.
Deploy Ladill Queue / deploy (push) Successful in 56s
Deploy Ladill Queue / deploy (push) Successful in 56s
Phases 1–6: tickets, counters, displays, appointments, workflows, rules, analytics, reports, feedback, admin, device API, and Gitea deploy workflow for queue.ladill.com. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Support;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class DatabaseTime
|
||||
{
|
||||
public static function diffSeconds(string $fromColumn, string $toColumn): string
|
||||
{
|
||||
return match (DB::connection()->getDriverName()) {
|
||||
'sqlite' => "CAST((julianday({$toColumn}) - julianday({$fromColumn})) * 86400 AS INTEGER)",
|
||||
default => "TIMESTAMPDIFF(SECOND, {$fromColumn}, {$toColumn})",
|
||||
};
|
||||
}
|
||||
|
||||
public static function hourOf(string $column): string
|
||||
{
|
||||
return match (DB::connection()->getDriverName()) {
|
||||
'sqlite' => "CAST(strftime('%H', {$column}) AS INTEGER)",
|
||||
default => "HOUR({$column})",
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user