We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e3c523 commit c36abcdCopy full SHA for c36abcd
src/Utils/Uuid.php
@@ -2,6 +2,8 @@
2
3
namespace ZhenMu\Support\Utils;
4
5
+use Illuminate\Support\Facades\DB;
6
+
7
class Uuid
8
{
9
public static function uuid($hex = true)
@@ -15,7 +17,7 @@ public static function uuid($hex = true)
15
17
16
18
public static function getCurrentSerialNumber(string $modelClass, $serialNumberField = 'serial_number'): int
19
- return $modelClass::whereDate('created_at', now())->max($serialNumberField) ?? 0;
20
+ return $modelClass::whereDate('created_at', now())->max(DB::raw("cast({$serialNumberField} as INTEGER)")) ?? 0;
21
}
22
23
public static function generateNextSerialNumberNo(int $serialNumber, int $padLength = 3): string
0 commit comments