Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zhupu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sugar
zhupu
Commits
043875ce
Commit
043875ce
authored
Sep 23, 2023
by
wuxiaoli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
5e254bbe
Pipeline
#750
canceled with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
16 deletions
+20
-16
application/api/controller/Friend.php
application/api/controller/Friend.php
+18
-14
application/api/controller/Users.php
application/api/controller/Users.php
+2
-2
No files found.
application/api/controller/Friend.php
View file @
043875ce
...
...
@@ -376,25 +376,29 @@ class Friend extends Api{
}
else
if
(
$type
==
3
){
//同乡
$where
[
'village_id'
]
=
$this
->
auth
->
village_id
;
}
else
if
(
$type
==
4
){
//同校
$educational
=
UsersModel
::
where
([
'id'
=>
$this
->
auth
->
id
])
->
value
(
"educational"
);
$school
=
array_column
(
json_decode
(
$educational
),
"school"
);
$where
=
''
;
foreach
(
$school
as
$k
=>
$v
){
if
(
$k
==
0
){
$where
=
" educational like '%"
.
$v
.
"%'"
;
}
else
{
$where
=
$where
.
" OR educational like '%"
.
$v
.
"%'"
;
$educational
=
UsersModel
::
where
([
'id'
=>
$this
->
auth
->
id
])
->
value
(
"educational"
);
if
(
$educational
){
$school
=
array_column
(
json_decode
(
$educational
),
"school"
);
foreach
(
$school
as
$k
=>
$v
){
if
(
$k
==
0
){
$where
=
" educational like '%"
.
$v
.
"%'"
;
}
else
{
$where
=
$where
.
" OR educational like '%"
.
$v
.
"%'"
;
}
}
}
}
else
if
(
$type
==
5
){
//同事
$work_experience
=
UsersModel
::
where
([
'id'
=>
$this
->
auth
->
id
])
->
value
(
"work_experience"
);
$company
=
array_column
(
json_decode
(
$work_experience
),
"company"
);
$where
=
''
;
foreach
(
$company
as
$k
=>
$v
){
if
(
$k
==
0
){
$where
=
" work_experience like '%"
.
$v
.
"%'"
;
}
else
{
$where
=
$where
.
" OR work_experience like '%"
.
$v
.
"%'"
;
$work_experience
=
UsersModel
::
where
([
'id'
=>
$this
->
auth
->
id
])
->
value
(
"work_experience"
);
if
(
$work_experience
){
$company
=
array_column
(
json_decode
(
$work_experience
),
"company"
);
foreach
(
$company
as
$k
=>
$v
){
if
(
$k
==
0
){
$where
=
" work_experience like '%"
.
$v
.
"%'"
;
}
else
{
$where
=
$where
.
" OR work_experience like '%"
.
$v
.
"%'"
;
}
}
}
}
...
...
application/api/controller/Users.php
View file @
043875ce
...
...
@@ -137,8 +137,8 @@ class Users extends Api
$userinfo
[
'certification_fee'
]
=
\think\Config
::
get
(
'site.certification_fee'
);
//处理教育,工作字段
$userinfo
[
'educational'
]
=
json_decode
(
$userinfo
[
'educational'
])
;
$userinfo
[
'work_experience'
]
=
json_decode
(
$userinfo
[
'work_experience'
])
;
$userinfo
[
'educational'
]
=
$userinfo
[
'educational'
]
?
json_decode
(
$userinfo
[
'educational'
])
:
''
;
$userinfo
[
'work_experience'
]
=
$userinfo
[
'work_experience'
]
?
json_decode
(
$userinfo
[
'work_experience'
])
:
''
;
if
(
$this
->
auth
->
village_id
>
0
)
{
$userinfo
[
'addr_name'
]
=
Db
::
name
(
"addr_village"
)
->
where
([
'village_code'
=>
$this
->
auth
->
village_id
])
->
field
(
'province,city,county,town,village'
)
->
find
();
}
...
...
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