Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Cong.Zhao
/
musician-api.hikoon.com
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
7dca7a31
...
7dca7a317ecaa4397dd4fcb2634ea4faa14cc6c9
authored
2021-07-02 19:22:03 +0800
by
lemon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
*
1 parent
95a3bd49
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
app/Http/Middleware/AuthIdentifier.php
app/Models/Legal/Stakeholder.php
app/Http/Middleware/AuthIdentifier.php
View file @
7dca7a3
...
...
@@ -48,7 +48,7 @@ class AuthIdentifier
if
(
empty
(
$identifier
))
return
Response
::
error
(
ErrorCode
::
IDENTIFIER_FAIL
);
$identifier
=
json_decode
(
$identifier
);
//通过身份证查询id
$stakeholder_ids
=
Stakeholder
::
stakeholderIds
(
$identifier
);
if
(
empty
(
$stakeholder_ids
))
return
Response
::
error
(
ErrorCode
::
MATCH_IDENTIFIER_FAIL
);
...
...
app/Models/Legal/Stakeholder.php
View file @
7dca7a3
...
...
@@ -28,25 +28,28 @@ class Stakeholder extends BaseModel
*/
public
static
function
stakeholderIds
(
object
$identifier
)
{
$stakeholders_model
=
Stakeholder
::
query
();
switch
(
intval
(
$identifier
->
type
))
{
case
1
:
//个人
$s_table
=
Stakeholder
::
table
();
$sbd_table
=
StakeholderBankDetail
::
table
();
$stakeholder
=
$stakeholders_model
->
where
([
'type'
=>
1
,
"
{
$sbd_table
}
.card_no"
=>
$identifier
->
identifier
])
->
join
(
$sbd_table
,
"
{
$s_table
}
.id"
,
'='
,
"
{
$sbd_table
}
.stakeholder_id"
)
->
pluck
(
"
{
$s_table
}
.id"
);
$stakeholder
=
Stakeholder
::
query
()
->
where
([
'type'
=>
1
,
"
{
$sbd_table
}
.card_no"
=>
$identifier
->
identifier
])
->
join
(
$sbd_table
,
"
{
$s_table
}
.id"
,
'='
,
"
{
$sbd_table
}
.stakeholder_id"
)
->
pluck
(
"
{
$s_table
}
.id"
)
->
toArray
();
$stakeholder_ids
=
Stakeholder
::
query
()
->
where
([
'type'
=>
1
,
'card_no'
=>
$identifier
->
identifier
])
->
pluck
(
'id'
)
->
toArray
();
$stakeholder
=
array_merge
(
$stakeholder
,
$stakeholder_ids
);
break
;
case
2
:
$stakeholder
=
$stakeholders_model
->
where
([
'type'
=>
2
,
'company_no'
=>
$identifier
->
identifier
])
->
pluck
(
'id'
);
$stakeholder
=
Stakeholder
::
query
()
->
where
([
'type'
=>
2
,
'company_no'
=>
$identifier
->
identifier
])
->
pluck
(
'id'
)
->
toArray
(
);
break
;
default
:
return
[];
break
;
}
return
array_unique
(
$stakeholder
->
toArray
()
);
return
array_unique
(
$stakeholder
);
}
}
...
...
Please
register
or
sign in
to post a comment