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
91390ae0
authored
Oct 12, 2020
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整公司model
parent
8600c65d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
34 deletions
app/Model/UserCompanyModel.php
app/Model/UserCompanyModel.php
View file @
91390ae0
<?php
<?php
namespace
App\Model
;
namespace
App\Model
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\Model
;
use
Request
;
use
Request
;
use
Excel
;
use
Excel
;
use
DB
;
use
DB
;
use
App\Model\RegionModel
;
use
App\Model\RegionModel
;
class
UserCompanyModel
extends
Model
class
UserCompanyModel
extends
Model
{
{
protected
$connection
=
'order'
;
protected
$connection
=
'order'
;
protected
$table
=
'lie_user_company'
;
protected
$table
=
'lie_user_company'
;
protected
$primaryKey
=
'com_id'
;
protected
$primaryKey
=
'com_id'
;
public
$timestamps
=
false
;
public
$timestamps
=
false
;
// 获取公司信息
// 获取公司信息
public
function
getCompanyInfo
(
$user_id
)
public
function
getCompanyInfo
(
$user_id
)
{
{
$info
=
$this
->
where
(
'user_id'
,
$user_id
)
->
first
();
$info
=
$this
->
where
(
'user_id'
,
$user_id
)
->
first
();
// 公司性质
if
(
!
$info
)
return
false
;
$company_type
=
Config
(
'params.company_type'
);
$info
[
'type_id_val'
]
=
$company_type
[
$info
[
'type_id'
]];
// 公司性质
$company_type
=
Config
(
'params.company_type'
);
// 省市区
$info
[
'type_id_val'
]
=
$company_type
[
$info
[
'type_id'
]];
$RegionModel
=
new
RegionModel
;
$info
[
'com_province'
]
=
$RegionModel
->
getRegionName
(
$info
[
'com_province_id'
]);
// 省市区
$info
[
'com_city'
]
=
$RegionModel
->
getRegionName
(
$info
[
'com_city_id'
]);
$RegionModel
=
new
RegionModel
;
$info
[
'com_area'
]
=
$RegionModel
->
getRegionName
(
$info
[
'com_area_id'
]);
$info
[
'com_province'
]
=
$RegionModel
->
getRegionName
(
$info
[
'com_province_id'
]);
$info
[
'com_city'
]
=
$RegionModel
->
getRegionName
(
$info
[
'com_city_id'
]);
return
$info
;
$info
[
'com_area'
]
=
$RegionModel
->
getRegionName
(
$info
[
'com_area_id'
]);
}
return
$info
;
}
}
}
\ 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