Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meibuyu-rpc
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
0
Merge Requests
0
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-rpc
Commits
3635d0c1
Commit
3635d0c1
authored
May 07, 2020
by
王源
🎧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复生成验证bug
parent
84d84ec6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
MakeModelCommand.php
src/Command/MakeModelCommand.php
+3
-3
repository.stub
src/Command/stubs/repository.stub
+4
-4
No files found.
src/Command/MakeModelCommand.php
View file @
3635d0c1
...
@@ -485,7 +485,7 @@ class MakeModelCommand extends HyperfCommand
...
@@ -485,7 +485,7 @@ class MakeModelCommand extends HyperfCommand
}
}
$rs
=
[];
$rs
=
[];
$required
=
"nullable"
;
$required
=
"nullable"
;
if
(
$null
==
'YES'
)
{
if
(
$null
!
==
'YES'
)
{
if
(
!
$default
)
{
if
(
!
$default
)
{
$required
=
"required"
;
$required
=
"required"
;
$messages
[]
=
"
\t\t
'
{
$name
}
.
{
$required
}
' => '
{
$msgName
}
不能为空!'"
;
$messages
[]
=
"
\t\t
'
{
$name
}
.
{
$required
}
' => '
{
$msgName
}
不能为空!'"
;
...
@@ -518,8 +518,8 @@ class MakeModelCommand extends HyperfCommand
...
@@ -518,8 +518,8 @@ class MakeModelCommand extends HyperfCommand
case
"text"
:
case
"text"
:
$rs
[]
=
'string'
;
$rs
[]
=
'string'
;
if
(
$length
)
{
if
(
$length
)
{
$rs
[]
=
'
size
:'
.
$length
;
$rs
[]
=
'
max
:'
.
$length
;
$messages
[]
=
"
\t\t
'
{
$name
}
.
size
' => '
{
$msgName
}
字符长度不能超过
{
$length
}
!'"
;
$messages
[]
=
"
\t\t
'
{
$name
}
.
max
' => '
{
$msgName
}
字符长度不能超过
{
$length
}
!'"
;
}
}
break
;
break
;
case
"date"
:
case
"date"
:
...
...
src/Command/stubs/repository.stub
View file @
3635d0c1
...
@@ -26,18 +26,18 @@ class %ModelClass%RepositoryEloquent extends BaseRepository implements %ModelCla
...
@@ -26,18 +26,18 @@ class %ModelClass%RepositoryEloquent extends BaseRepository implements %ModelCla
/**
/**
* %ModelClass% 模型
* %ModelClass% 模型
* @return
%ModelClass%|string
* @return
mixed
*/
*/
public
function
model
()
:
%
ModelClass
%
public
function
model
()
{
{
return
%
ModelClass
%::
class
;
return
%
ModelClass
%::
class
;
}
}
/**
/**
* 数据校验器
* 数据校验器
* @return
%ModelClass%Validator|string
* @return
mixed
*/
*/
public
function
validator
()
:
%
ModelClass
%
Validator
public
function
validator
()
{
{
return
%
ModelClass
%
Validator
::
class
;
return
%
ModelClass
%
Validator
::
class
;
}
}
...
...
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