Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meibuyu-micro
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
without authentication
meibuyu-micro
Commits
0be2078e
Commit
0be2078e
authored
May 09, 2020
by
梁俊杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
时间戳问题修复
parent
86353fd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
MakeModelCommand.php
src/Command/MakeModelCommand.php
+7
-1
No files found.
src/Command/MakeModelCommand.php
View file @
0be2078e
...
@@ -344,9 +344,11 @@ class MakeModelCommand extends HyperfCommand
...
@@ -344,9 +344,11 @@ class MakeModelCommand extends HyperfCommand
];
];
$properties
.=
" * @property "
.
(
isset
(
$pc
[
$v
[
'data_type'
]])
?
$pc
[
$v
[
'data_type'
]]
:
"string"
)
.
" $"
.
$name
.
(
$v
[
'column_comment'
]
?
" "
.
$v
[
'column_comment'
]
:
""
)
.
"
\n
"
;
$properties
.=
" * @property "
.
(
isset
(
$pc
[
$v
[
'data_type'
]])
?
$pc
[
$v
[
'data_type'
]]
:
"string"
)
.
" $"
.
$name
.
(
$v
[
'column_comment'
]
?
" "
.
$v
[
'column_comment'
]
:
""
)
.
"
\n
"
;
if
(
$name
==
'created_at'
||
$name
==
'updated_at'
)
{
if
(
$name
==
'created_at'
||
$name
==
'updated_at'
)
{
$casts
.=
"
\t\t
'"
.
$name
.
"'=>'datetime',
\n
"
;
$timestamps
++
;
$timestamps
++
;
}
}
if
(
$name
==
'deleted_at'
)
{
if
(
$name
==
'deleted_at'
)
{
$casts
.=
"
\t\t
'"
.
$name
.
"'=>'datetime',
\n
"
;
$softDelete
=
true
;
$softDelete
=
true
;
}
}
if
(
in_array
(
$name
,
$filterFields
))
{
if
(
in_array
(
$name
,
$filterFields
))
{
...
@@ -926,7 +928,11 @@ class MakeModelCommand extends HyperfCommand
...
@@ -926,7 +928,11 @@ class MakeModelCommand extends HyperfCommand
$fields
[]
=
"
\t\t\t\t
'
{
$name
}
' =>
\$
faker->time('H:i:s'),"
;
$fields
[]
=
"
\t\t\t\t
'
{
$name
}
' =>
\$
faker->time('H:i:s'),"
;
break
;
break
;
case
"timestamp"
:
case
"timestamp"
:
$fields
[]
=
"
\t\t\t\t
'
{
$name
}
' =>
\$
faker->unixTime(),"
;
if
(
$name
==
'created_at'
||
$name
==
'updated_at'
||
$name
==
'deleted_at'
)
{
$fields
[]
=
"
\t\t\t\t
'
{
$name
}
' =>
\$
faker->date('Y-m-d').' '.
\$
faker->time('H:i:s'),"
;
}
else
{
$fields
[]
=
"
\t\t\t\t
'
{
$name
}
' =>
\$
faker->unixTime(),"
;
}
break
;
break
;
case
"year"
:
case
"year"
:
$fields
[]
=
"
\t\t\t\t
'
{
$name
}
' =>
\$
faker->year(),"
;
$fields
[]
=
"
\t\t\t\t
'
{
$name
}
' =>
\$
faker->year(),"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment