Toggle navigation
Toggle navigation
This project
Loading...
Sign in
OnePoem
/
OnePoem-Server
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
李帅
2022-12-22 02:04:46 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5ebf927e8aa60c0c57c328436b2f807a4d810baa
5ebf927e
1 parent
3073f8bf
1.打印苹果日志
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
app/Models/Order.php
app/Models/Order.php
View file @
5ebf927
...
...
@@ -45,8 +45,19 @@ class Order extends Model
*/
static
public
function
get_sn
(
$prefix
=
''
)
{
$Sn
=
$prefix
.
strtoupper
(
dechex
(
date
(
'm'
)))
.
date
(
'd'
)
.
substr
(
time
(),
-
5
)
.
substr
(
microtime
(),
2
,
5
)
.
sprintf
(
'%02d'
,
rand
(
0
,
99
));
return
$Sn
;
$chars
=
md5
(
uniqid
(
mt_rand
(),
true
));
$len
=
strlen
(
$prefix
);
if
(
$len
>
5
)
$prefix
=
substr
(
$prefix
,
0
,
5
);
$uuid
=
$prefix
.
dechex
(
date
(
'm'
))
.
date
(
'd'
)
.
substr
(
time
(),
-
5
+
$len
)
.
'-'
.
substr
(
microtime
(),
2
,
4
)
.
'-'
.
substr
(
$chars
,
12
,
4
)
.
'-'
.
substr
(
$chars
,
16
,
4
)
.
'-'
.
substr
(
$chars
,
20
,
12
);
return
strtoupper
(
$uuid
);
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment