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
e65fe2f9
authored
Oct 12, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'zjl_new_order_20210926' into development
parents
9f603b53
f33397ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
27 deletions
app/Model/RegionModel.php
app/Model/RegionModel.php
View file @
e65fe2f9
<?php
namespace
App\Model
;
use
Illuminate\Database\Eloquent\Model
;
class
RegionModel
extends
Model
{
protected
$connection
=
'
order'
;
protected
$table
=
'lie_region'
;
protected
$primaryKey
=
'region_id'
;
public
$timestamps
=
false
;
// 获取指定类型地址
public
function
getRegion
(
$region_type
=
1
)
{
$map
[
'region_type'
]
=
$region_type
;
return
$this
->
where
(
$map
)
->
select
(
'region_id'
,
'parent_id'
,
'region_name'
)
->
get
()
->
toArray
();
}
// 获取地址名称
public
function
getRegionName
(
$region_id
)
{
if
(
!
$region_id
)
return
null
;
return
$this
->
where
(
'region_id'
,
$region_id
)
->
value
(
'region_name'
);
}
<?php
namespace
App\Model
;
use
Illuminate\Database\Eloquent\Model
;
class
RegionModel
extends
Model
{
protected
$connection
=
'
web'
;
protected
$table
=
'lie_region'
;
protected
$primaryKey
=
'region_id'
;
public
$timestamps
=
false
;
// 获取指定类型地址
public
function
getRegion
(
$region_type
=
1
)
{
$map
[
'region_type'
]
=
$region_type
;
return
$this
->
where
(
$map
)
->
select
(
'region_id'
,
'parent_id'
,
'region_name'
)
->
get
()
->
toArray
();
}
// 获取地址名称
public
function
getRegionName
(
$region_id
)
{
if
(
!
$region_id
)
return
null
;
return
$this
->
where
(
'region_id'
,
$region_id
)
->
value
(
'region_name'
);
}
}
\ No newline at end of file
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