Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
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
05e9a79d
authored
Sep 09, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整db
parent
dc1fceef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
app/Http/Controllers/AddressController.php
app/Http/Controllers/AddressController.php
View file @
05e9a79d
...
@@ -58,7 +58,7 @@ class AddressController extends Controller
...
@@ -58,7 +58,7 @@ class AddressController extends Controller
// 地址
// 地址
public
function
getRegion
(
$region_id
)
public
function
getRegion
(
$region_id
)
{
{
$region
=
DB
::
connection
(
'
memb
er'
)
->
table
(
'lie_region'
)
->
where
(
'region_id'
,
$region_id
)
->
select
(
'region_name'
)
->
first
();
$region
=
DB
::
connection
(
'
ord
er'
)
->
table
(
'lie_region'
)
->
where
(
'region_id'
,
$region_id
)
->
select
(
'region_name'
)
->
first
();
return
$region
?
$region
->
region_name
:
''
;
return
$region
?
$region
->
region_name
:
''
;
}
}
...
@@ -69,7 +69,7 @@ class AddressController extends Controller
...
@@ -69,7 +69,7 @@ class AddressController extends Controller
if
(
$request
->
isMethod
(
'post'
))
{
if
(
$request
->
isMethod
(
'post'
))
{
$address_id
=
$request
->
input
(
'address_id'
);
$address_id
=
$request
->
input
(
'address_id'
);
$info
=
DB
::
connection
(
'
memb
er'
)
->
table
(
'lie_user_address'
)
->
where
(
'address_id'
,
$address_id
)
->
first
();
$info
=
DB
::
connection
(
'
ord
er'
)
->
table
(
'lie_user_address'
)
->
where
(
'address_id'
,
$address_id
)
->
first
();
if
(
empty
(
$info
))
return
[
'errcode'
=>
Error
::
E_NOT_EXISTS
,
'errmsg'
=>
'未找到'
];
if
(
empty
(
$info
))
return
[
'errcode'
=>
Error
::
E_NOT_EXISTS
,
'errmsg'
=>
'未找到'
];
...
@@ -160,13 +160,13 @@ class AddressController extends Controller
...
@@ -160,13 +160,13 @@ class AddressController extends Controller
}
}
if
(
$map
[
'user_id'
]
&&
isset
(
$map
[
'address_type'
]))
{
if
(
$map
[
'user_id'
]
&&
isset
(
$map
[
'address_type'
]))
{
$addressList
=
DB
::
connection
(
'
memb
er'
)
->
table
(
'lie_user_address'
)
->
where
(
$map
)
->
get
();
$addressList
=
DB
::
connection
(
'
ord
er'
)
->
table
(
'lie_user_address'
)
->
where
(
$map
)
->
get
();
}
}
if
(
!
empty
(
$addressList
)
&&
is_array
(
$addressList
))
{
if
(
!
empty
(
$addressList
)
&&
is_array
(
$addressList
))
{
$region
=
array
();
$region
=
array
();
foreach
(
$addressList
as
&
$val
)
{
foreach
(
$addressList
as
&
$val
)
{
$region
=
DB
::
connection
(
'
memb
er'
)
$region
=
DB
::
connection
(
'
ord
er'
)
->
table
(
'lie_region'
)
->
table
(
'lie_region'
)
->
whereIn
(
'region_id'
,
[
$val
->
province
,
$val
->
city
,
$val
->
district
])
->
whereIn
(
'region_id'
,
[
$val
->
province
,
$val
->
city
,
$val
->
district
])
->
select
(
'region_id'
,
'region_name'
)
->
select
(
'region_id'
,
'region_name'
)
...
...
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