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
91582e58
Commit
91582e58
authored
Sep 23, 2023
by
sugar
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://rungit.jxdsy.cn:10000/sugar/zhupu
into dev
parents
c235dc61
043875ce
Pipeline
#751
canceled with stages
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
122 additions
and
23 deletions
+122
-23
application/admin/lang/zh-cn/family/family_people.php
application/admin/lang/zh-cn/family/family_people.php
+1
-0
application/admin/view/family/family_people/add.html
application/admin/view/family/family_people/add.html
+6
-0
application/admin/view/family/family_people/edit.html
application/admin/view/family/family_people/edit.html
+6
-0
application/api/controller/Family.php
application/api/controller/Family.php
+9
-1
application/api/controller/FamilyTree.php
application/api/controller/FamilyTree.php
+6
-0
application/api/controller/Friend.php
application/api/controller/Friend.php
+61
-20
application/api/controller/Users.php
application/api/controller/Users.php
+26
-1
application/api/model/UsersModel.php
application/api/model/UsersModel.php
+6
-0
application/common/library/Auth.php
application/common/library/Auth.php
+1
-1
No files found.
application/admin/lang/zh-cn/family/family_people.php
View file @
91582e58
...
@@ -36,4 +36,5 @@ return [
...
@@ -36,4 +36,5 @@ return [
'Audit 1'
=>
'通过'
,
'Audit 1'
=>
'通过'
,
'Audit 2'
=>
'失败'
,
'Audit 2'
=>
'失败'
,
'Sleep_place'
=>
'安息地'
,
'Sleep_place'
=>
'安息地'
,
'Type_label'
=>
'标签'
,
];
];
application/admin/view/family/family_people/add.html
View file @
91582e58
...
@@ -27,6 +27,12 @@
...
@@ -27,6 +27,12 @@
{:build_radios('row[ext0]', ['0'=>__('否'), '1'=>__('是'), '2'=>__('未知')], 1)}
{:build_radios('row[ext0]', ['0'=>__('否'), '1'=>__('是'), '2'=>__('未知')], 1)}
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Type_label')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
{:build_radios('row[type_label]', ['1'=>__('千古流芳'), '2'=>__('当代名流')], 1)}
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Photo')}:
</label>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Photo')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<div
class=
"col-xs-12 col-sm-8"
>
...
...
application/admin/view/family/family_people/edit.html
View file @
91582e58
...
@@ -26,6 +26,12 @@
...
@@ -26,6 +26,12 @@
{:build_radios('row[ext0]', ['0'=>__('否'), '1'=>__('是'), '2'=>__('未知')], $row.ext0)}
{:build_radios('row[ext0]', ['0'=>__('否'), '1'=>__('是'), '2'=>__('未知')], $row.ext0)}
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Type_label')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
{:build_radios('row[type_label]', ['1'=>__('千古流芳'), '2'=>__('当代名流')], $row.type_label)}
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Photo')}:
</label>
<label
class=
"control-label col-xs-12 col-sm-2"
>
{:__('Photo')}:
</label>
<div
class=
"col-xs-12 col-sm-8"
>
<div
class=
"col-xs-12 col-sm-8"
>
...
...
application/api/controller/Family.php
View file @
91582e58
...
@@ -80,7 +80,7 @@ class Family extends Api
...
@@ -80,7 +80,7 @@ class Family extends Api
$FamilyTreeMate
=
FamilyModel
::
myFamilyTreeMateList
(
"ftm.people_id = "
.
$val
[
'id'
]);
$FamilyTreeMate
=
FamilyModel
::
myFamilyTreeMateList
(
"ftm.people_id = "
.
$val
[
'id'
]);
array_push
(
$arr
,
$FamilyTree
,
$FamilyTreeMate
);
array_push
(
$arr
,
$FamilyTree
,
$FamilyTreeMate
);
}
}
$data
=
call_user_func_array
(
"array_merge"
,
$arr
);
$data
=
array_unique
(
call_user_func_array
(
"array_merge"
,
$arr
)
);
}
}
$arr
=
[];
$arr
=
[];
foreach
(
$data
as
$key
=>
$val
){
foreach
(
$data
as
$key
=>
$val
){
...
@@ -94,6 +94,14 @@ class Family extends Api
...
@@ -94,6 +94,14 @@ class Family extends Api
$addr
=
Db
::
name
(
"addr"
)
->
where
([
'ID'
=>
$val
[
'area_id'
]])
->
field
(
'ID as value,Name as name, ParentId,MergerName'
)
->
find
();
$addr
=
Db
::
name
(
"addr"
)
->
where
([
'ID'
=>
$val
[
'area_id'
]])
->
field
(
'ID as value,Name as name, ParentId,MergerName'
)
->
find
();
$data
[
$key
][
'addr'
]
=
$addr
[
'MergerName'
];
$data
[
$key
][
'addr'
]
=
$addr
[
'MergerName'
];
}
}
$rw_user_ids
=
explode
(
","
,
$val
[
'rw_user_id'
]);
$array
=
array
();
foreach
(
$rw_user_ids
as
$k
=>
$v
){
$realname
=
UsersModel
::
where
([
'id'
=>
$v
])
->
value
(
"realname"
);
array_push
(
$array
,
$realname
);
$realname
?
array_push
(
$array
,
$realname
)
:
''
;
}
$data
[
$key
][
'agent_realname'
]
=
array_unique
(
$array
);
if
(
$val
[
'type'
]
==
2
){
//有族谱就显示族谱
if
(
$val
[
'type'
]
==
2
){
//有族谱就显示族谱
$arr
[]
=
$val
;
$arr
[]
=
$val
;
}
}
...
...
application/api/controller/FamilyTree.php
View file @
91582e58
...
@@ -631,8 +631,10 @@ class FamilyTree extends Api
...
@@ -631,8 +631,10 @@ class FamilyTree extends Api
public
function
celebrityList
(){
public
function
celebrityList
(){
$page
=
$this
->
request
->
param
(
'page'
,
1
);
$page
=
$this
->
request
->
param
(
'page'
,
1
);
$type
=
$this
->
request
->
param
(
'type'
,
1
);
$type
=
$this
->
request
->
param
(
'type'
,
1
);
$type_label
=
$this
->
request
->
param
(
'type_label'
,
1
);
$map
[
'type'
]
=
2
;
$map
[
'type'
]
=
2
;
$map
[
'status'
]
=
1
;
$map
[
'status'
]
=
1
;
$map
[
'type_label'
]
=
$type_label
;
if
(
$type
==
2
){
//同姓
if
(
$type
==
2
){
//同姓
$Surname
=
SurnameModel
::
where
([
"ID"
=>
$this
->
auth
->
surname_id
])
->
value
(
"Surname"
);
$Surname
=
SurnameModel
::
where
([
"ID"
=>
$this
->
auth
->
surname_id
])
->
value
(
"Surname"
);
$map
[
'surname'
]
=
$Surname
;
$map
[
'surname'
]
=
$Surname
;
...
@@ -640,6 +642,10 @@ class FamilyTree extends Api
...
@@ -640,6 +642,10 @@ class FamilyTree extends Api
$map
[
'province_id'
]
=
$this
->
auth
->
province_id
;
$map
[
'province_id'
]
=
$this
->
auth
->
province_id
;
}
else
if
(
$type
==
4
){
//同城
}
else
if
(
$type
==
4
){
//同城
$map
[
'city_id'
]
=
$this
->
auth
->
city_id
;
$map
[
'city_id'
]
=
$this
->
auth
->
city_id
;
}
else
if
(
$type
==
5
){
//同县
$map
[
'area_id'
]
=
$this
->
auth
->
area_id
;
}
else
if
(
$type
==
6
){
//同乡
$map
[
'village_id'
]
=
$this
->
auth
->
village_id
;
}
}
$data
=
FamilyPeopleModel
::
where
([
'type'
=>
2
,
'status'
=>
1
])
->
field
(
"*"
)
->
page
(
$page
)
->
limit
(
10
)
->
order
(
"ranking desc,id desc"
)
->
select
();
$data
=
FamilyPeopleModel
::
where
([
'type'
=>
2
,
'status'
=>
1
])
->
field
(
"*"
)
->
page
(
$page
)
->
limit
(
10
)
->
order
(
"ranking desc,id desc"
)
->
select
();
$this
->
success
(
""
,
$data
);
$this
->
success
(
""
,
$data
);
...
...
application/api/controller/Friend.php
View file @
91582e58
...
@@ -12,6 +12,7 @@ use app\api\model\FriendCommentModel;
...
@@ -12,6 +12,7 @@ use app\api\model\FriendCommentModel;
use
app\api\model\FriendLikeModel
;
use
app\api\model\FriendLikeModel
;
use
app\api\model\HotcircleModel
;
use
app\api\model\HotcircleModel
;
use
app\api\model\JoinCircle
;
use
app\api\model\JoinCircle
;
use
app\api\model\UsersModel
;
use
app\common\controller\Api
;
use
app\common\controller\Api
;
use
fast\Tree
;
use
fast\Tree
;
use
think\Db
;
use
think\Db
;
...
@@ -346,29 +347,69 @@ class Friend extends Api{
...
@@ -346,29 +347,69 @@ class Friend extends Api{
* 随机推荐好友
* 随机推荐好友
*/
*/
public
function
getRandomFriends
(){
public
function
getRandomFriends
(){
$where
=
[
'user_id'
=>
[
'neq'
,
$this
->
auth
->
id
]];
$type
=
$this
->
request
->
post
(
"type"
,
1
);
$total
=
Db
::
name
(
'fastim_user'
)
->
where
(
$where
)
->
count
();
if
(
$type
==
1
){
//推荐
$min
=
Db
::
name
(
'fastim_user'
)
->
where
(
$where
)
->
min
(
'id'
);
//统计某个字段最小数据
$where
=
[
'user_id'
=>
[
'neq'
,
$this
->
auth
->
id
]];
$num
=
30
;
$total
=
Db
::
name
(
'fastim_user'
)
->
where
(
$where
)
->
count
();
if
(
$total
<
$num
){
$num
=
$min
;}
$min
=
Db
::
name
(
'fastim_user'
)
->
where
(
$where
)
->
min
(
'id'
);
//统计某个字段最小数据
$i
=
1
;
$num
=
30
;
$flag
=
0
;
if
(
$total
<
$num
){
$num
=
$min
;}
$ary
=
[];
$i
=
1
;
while
(
$i
<=
$num
){
$flag
=
0
;
$rundnum
=
rand
(
$min
,
$total
);
//抽取随机数
$ary
=
[];
if
(
$flag
!=
$rundnum
){
while
(
$i
<=
$num
){
//过滤重复
$rundnum
=
rand
(
$min
,
$total
);
//抽取随机数
if
(
!
in_array
(
$rundnum
,
$ary
)){
if
(
$flag
!=
$rundnum
){
$ary
[]
=
$rundnum
;
//过滤重复
$flag
=
$rundnum
;
if
(
!
in_array
(
$rundnum
,
$ary
)){
}
else
{
$ary
[]
=
$rundnum
;
$i
--
;
$flag
=
$rundnum
;
}
else
{
$i
--
;
}
$i
++
;
}
}
$i
++
;
}
}
$map
[
'id'
]
=
[
'in'
,
$ary
];
}
else
{
if
(
$type
==
2
){
//同姓
$where
[
'surname_id'
]
=
$this
->
auth
->
surname_id
;
}
else
if
(
$type
==
3
){
//同乡
$where
[
'village_id'
]
=
$this
->
auth
->
village_id
;
}
else
if
(
$type
==
4
){
//同校
$where
=
''
;
$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
){
//同事
$where
=
''
;
$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
.
"%'"
;
}
}
}
}
$ids
=
UsersModel
::
where
(
$where
)
->
column
(
"id"
);
$map
[
'user_id'
]
=
[
'in'
,
$ids
];
}
}
$list
=
Db
::
name
(
'fastim_user'
)
->
where
(
$where
)
->
where
([
'id'
=>
[
'in'
,
$ary
]])
->
select
();
$this
->
success
(
'操作成功'
,[
'list'
=>
$list
]);
$list
=
Db
::
name
(
'fastim_user'
)
->
where
([
'user_id'
=>
[
'neq'
,
$this
->
auth
->
id
]])
->
where
(
$map
)
->
limit
(
30
)
->
select
();
$this
->
success
(
'操作成功'
,[
'list'
=>
$list
]);
}
}
}
}
\ No newline at end of file
application/api/controller/Users.php
View file @
91582e58
...
@@ -133,11 +133,36 @@ class Users extends Api
...
@@ -133,11 +133,36 @@ class Users extends Api
*/
*/
public
function
getUserinfo
()
public
function
getUserinfo
()
{
{
$userinfo
=
$this
->
auth
->
getUserinfo
(
);
$userinfo
=
UsersModel
::
getUserinfo
(
$this
->
auth
->
id
);
$userinfo
[
'certification_fee'
]
=
\think\Config
::
get
(
'site.certification_fee'
);
$userinfo
[
'certification_fee'
]
=
\think\Config
::
get
(
'site.certification_fee'
);
//处理教育,工作字段
$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
();
}
$this
->
success
(
'获取成功'
,
[
'userinfo'
=>
$userinfo
]);
$this
->
success
(
'获取成功'
,
[
'userinfo'
=>
$userinfo
]);
}
}
/**
* 修改用户信息
*/
public
function
updateUserinfo
(){
$params
=
$this
->
request
->
param
();
if
(
!
empty
(
$params
[
'educational'
])){
$params
[
'educational'
]
=
htmlspecialchars_decode
(
$params
[
'educational'
]);
}
if
(
!
empty
(
$params
[
'work_experience'
])){
$params
[
'work_experience'
]
=
htmlspecialchars_decode
(
$params
[
'work_experience'
]);
}
UsersModel
::
where
([
'id'
=>
$this
->
auth
->
id
])
->
update
(
$params
);
$this
->
success
(
"修改成功"
);
}
/**
/**
* 创建IM用户并初始化
* 创建IM用户并初始化
...
...
application/api/model/UsersModel.php
View file @
91582e58
...
@@ -72,4 +72,10 @@ class UsersModel extends BaseModel {
...
@@ -72,4 +72,10 @@ class UsersModel extends BaseModel {
}
}
return
false
;
return
false
;
}
}
public
static
function
getUserinfo
(
$id
,
$field
=
[
'id'
,
'username'
,
'nickname'
,
'mobile'
,
'avatar'
,
'score'
,
'prevtime'
,
'wx_openid'
,
'app_openid'
,
'unionid'
,
'money'
,
'level'
,
'is_shaikh'
,
'commission'
,
'agent_money'
,
'province_id'
,
'city_id'
,
'area_id'
,
'town_id'
,
'village_id'
,
'educational'
,
'work_experience'
]){
return
self
::
where
([
'id'
=>
$id
])
->
field
(
$field
)
->
find
();
}
}
}
\ No newline at end of file
application/common/library/Auth.php
View file @
91582e58
...
@@ -29,7 +29,7 @@ class Auth
...
@@ -29,7 +29,7 @@ class Auth
//默认配置
//默认配置
protected
$config
=
[];
protected
$config
=
[];
protected
$options
=
[];
protected
$options
=
[];
protected
$allowFields
=
[
'id'
,
'username'
,
'nickname'
,
'mobile'
,
'avatar'
,
'score'
,
'prevtime'
,
'wx_openid'
,
'app_openid'
,
'unionid'
,
'money'
,
'level'
,
'is_shaikh'
,
'commission'
,
'agent_money'
,
'province_id'
,
'city_id'
,
'area_id'
,
'town_id'
,
'village_id'
];
protected
$allowFields
=
[
'id'
,
'username'
,
'surname_id'
,
'nickname'
,
'mobile'
,
'avatar'
,
'score'
,
'prevtime'
,
'wx_openid'
,
'app_openid'
,
'unionid'
,
'money'
,
'level'
,
'is_shaikh'
,
'commission'
,
'agent_money'
,
'province_id'
,
'city_id'
,
'area_id'
,
'town_id'
,
'village_id'
];
public
function
__construct
(
$options
=
[])
public
function
__construct
(
$options
=
[])
{
{
...
...
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