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
567a1b69
authored
Nov 24, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
去除中间件
parent
4a0caec5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
app/Http/Kernel.php
app/Http/Services/UserAddressService.php
app/Http/Kernel.php
View file @
567a1b69
...
@@ -20,7 +20,7 @@ class Kernel extends HttpKernel
...
@@ -20,7 +20,7 @@ class Kernel extends HttpKernel
\App\Http\Middleware\CheckForMaintenanceMode
::
class
,
\App\Http\Middleware\CheckForMaintenanceMode
::
class
,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize
::
class
,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize
::
class
,
\App\Http\Middleware\TrimStrings
::
class
,
\App\Http\Middleware\TrimStrings
::
class
,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull
::
class
,
//
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
];
];
/**
/**
...
...
app/Http/Services/UserAddressService.php
View file @
567a1b69
...
@@ -16,9 +16,7 @@ class UserAddressService
...
@@ -16,9 +16,7 @@ class UserAddressService
$address
[
'email'
]
=
$user
->
email
;
$address
[
'email'
]
=
$user
->
email
;
$address
[
'phone'
]
=
$user
->
phone
;
$address
[
'phone'
]
=
$user
->
phone
;
}
}
if
(
empty
(
$address
[
'company_name'
]))
{
$address
[
'company_name'
]
=
''
;
}
$address
[
'user_id'
]
=
$user
->
id
;
$address
[
'user_id'
]
=
$user
->
id
;
$address
[
'create_time'
]
=
time
();
$address
[
'create_time'
]
=
time
();
//如果没有默认地址,那么就设置为默认地址
//如果没有默认地址,那么就设置为默认地址
...
@@ -35,9 +33,7 @@ class UserAddressService
...
@@ -35,9 +33,7 @@ class UserAddressService
public
static
function
updateUserAddress
(
$address
,
$user
)
public
static
function
updateUserAddress
(
$address
,
$user
)
{
{
return
DB
::
transaction
(
function
()
use
(
$address
,
$user
)
{
return
DB
::
transaction
(
function
()
use
(
$address
,
$user
)
{
if
(
empty
(
$address
[
'company_name'
]))
{
$address
[
'company_name'
]
=
''
;
}
if
(
$address
[
'is_default'
])
{
if
(
$address
[
'is_default'
])
{
UserAddressModel
::
where
(
'user_id'
,
$user
->
id
)
->
update
([
'is_default'
=>
0
]);
UserAddressModel
::
where
(
'user_id'
,
$user
->
id
)
->
update
([
'is_default'
=>
0
]);
}
}
...
...
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