Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
semour
/
semour_web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
93b04f4e
authored
Nov 24, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
地址页面
parent
ec46896a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
1 deletions
app/Http/Requests/UserAddressSave.php
app/Http/Requests/UserRegister.php
app/Models/UserAddressModel.php
app/Models/UserModel.php
app/Http/Requests/UserAddressSave.php
View file @
93b04f4e
...
...
@@ -2,6 +2,8 @@
namespace
App\Http\Requests
;
use
App\Models\UserAddressModel
;
use
App\Models\UserModel
;
use
Illuminate\Foundation\Http\FormRequest
;
class
UserAddressSave
extends
BaseRequest
...
...
@@ -32,7 +34,13 @@ class UserAddressSave extends BaseRequest
'company_name'
=>
'required|max:50'
,
'detail_address'
=>
'required|max:255'
,
'post_code'
=>
'required|max:10'
,
'address_type'
=>
'required|in:1,2'
];
if
(
request
()
->
input
(
'address_type'
)
==
UserAddressModel
::
ADDRESS_TYPE_COMPANY
)
{
$rules
[
'company_name'
]
=
'required|max:50'
;
}
$isRegister
=
request
()
->
input
(
'is_register'
);
if
(
!
$isRegister
)
{
$rules
[
'email'
]
=
'required|email'
;
...
...
app/Http/Requests/UserRegister.php
View file @
93b04f4e
...
...
@@ -33,7 +33,8 @@ class UserRegister extends BaseRequest
'phone'
=>
'required|max:100'
,
'account_properties'
=>
'required|in:1,2'
];
if
(
request
()
->
input
(
'account_properties'
)
==
2
)
{
if
(
request
()
->
input
(
'account_properties'
)
==
UserModel
::
ACCOUNT_PROPERTIES_COMPANY
)
{
$rule
[
'company_name'
]
=
'required|max:50'
;
}
return
$rule
;
...
...
app/Models/UserAddressModel.php
View file @
93b04f4e
...
...
@@ -14,6 +14,9 @@ class UserAddressModel extends Model
protected
$fillable
=
[
];
const
ADDRESS_TYPE_PERSONAL
=
1
;
const
ADDRESS_TYPE_COMPANY
=
2
;
public
function
user
()
{
return
$this
->
belongsTo
(
UserModel
::
class
);
...
...
app/Models/UserModel.php
View file @
93b04f4e
...
...
@@ -42,6 +42,11 @@ class UserModel extends Authenticatable implements MustVerifyEmail
'email_verified_at'
=>
'datetime'
,
];
const
ACCOUNT_PROPERTIES_PERSONAL
=
1
;
const
ACCOUNT_PROPERTIES_COMPANY
=
2
;
//获取用户详情
public
static
function
getUserInfo
(
$user_id
)
{
...
...
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