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
df7a59b2
Commit
df7a59b2
authored
Nov 22, 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
f2e65ec6
7d3c3620
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
2 deletions
+90
-2
application/api/controller/Family.php
application/api/controller/Family.php
+27
-1
application/api/controller/FamilyTree.php
application/api/controller/FamilyTree.php
+14
-0
application/lib/model/FamilyPeopleModel.php
application/lib/model/FamilyPeopleModel.php
+16
-0
application/lib/model/NameCardModel.php
application/lib/model/NameCardModel.php
+32
-0
application/lib/service/FamilyTreeService.php
application/lib/service/FamilyTreeService.php
+1
-1
No files found.
application/api/controller/Family.php
View file @
df7a59b2
...
@@ -14,6 +14,7 @@ use app\lib\model\FamilyModel;
...
@@ -14,6 +14,7 @@ use app\lib\model\FamilyModel;
use
app\lib\model\FamilyPeopleModel
;
use
app\lib\model\FamilyPeopleModel
;
use
app\lib\model\FamilyTreeMateModel
;
use
app\lib\model\FamilyTreeMateModel
;
use
app\lib\model\FamilyTreeModel
;
use
app\lib\model\FamilyTreeModel
;
use
app\lib\model\NameCardModel
;
use
app\lib\model\SurnameModel
;
use
app\lib\model\SurnameModel
;
use
app\lib\service\AddressService
;
use
app\lib\service\AddressService
;
use
function
PHPSTORM_META\elementType
;
use
function
PHPSTORM_META\elementType
;
...
@@ -46,6 +47,10 @@ class Family extends Api
...
@@ -46,6 +47,10 @@ class Family extends Api
$people_id
=
$this
->
request
->
param
(
"people_id"
);
//选择自己id
$people_id
=
$this
->
request
->
param
(
"people_id"
);
//选择自己id
$type
=
$this
->
request
->
param
(
"type"
,
2
);
//认领方式(2名片认领,3线上认领)
$activation_code
=
$this
->
request
->
param
(
"activation_code"
);
if
(
!
empty
(
$people_id
)){
if
(
!
empty
(
$people_id
)){
$people
=
FamilyPeopleModel
::
dataInfo
([
'id'
=>
$people_id
]);
$people
=
FamilyPeopleModel
::
dataInfo
([
'id'
=>
$people_id
]);
if
(
empty
(
$people
)){
if
(
empty
(
$people
)){
...
@@ -53,11 +58,32 @@ class Family extends Api
...
@@ -53,11 +58,32 @@ class Family extends Api
}
else
if
(
$people
&&
$people
[
'user_id'
]){
}
else
if
(
$people
&&
$people
[
'user_id'
]){
$this
->
error
(
"该成员已被账户关联"
);
$this
->
error
(
"该成员已被账户关联"
);
}
}
if
(
$people
[
'is_pay'
]
==
0
){
$this
->
success
(
"请激活!"
,
$people
);
}
$res
=
FamilyPeopleModel
::
dataUpdate
([
'id'
=>
$people_id
],[
'user_id'
=>
$this
->
auth
->
id
,
'fastim_id'
=>
$fastim_id
]);
$res
=
FamilyPeopleModel
::
dataUpdate
([
'id'
=>
$people_id
],[
'user_id'
=>
$this
->
auth
->
id
,
'fastim_id'
=>
$fastim_id
]);
if
(
$type
==
2
){
NameCardModel
::
dataUpdate
([
'activation_code'
=>
$activation_code
,
'user_id'
=>
0
],[
'user_id'
=>
$this
->
auth
->
id
]);}
$this
->
success
(
"该用户认领成功"
,
$res
);
$this
->
success
(
"该用户认领成功"
,
$res
);
}
else
{
}
else
{
$data
=
FamilyTreeModel
::
claimFamilyPeople
([
'ft1.name'
=>
$name
,
'ft2.name'
=>
$parent_name
,
'ft3.name'
=>
$grandpa_name
]);
$data
=
FamilyTreeModel
::
claimFamilyPeople
([
'ft1.name'
=>
$name
,
'ft2.name'
=>
$parent_name
,
'ft3.name'
=>
$grandpa_name
]);
$this
->
success
(
""
,
$data
);
$list
=
[];
if
(
$type
==
2
){
$family_id
=
NameCardModel
::
where
([
'activation_code'
=>
$activation_code
,
'user_id'
=>
0
])
->
value
(
"family_id"
);
foreach
(
$data
as
$key
=>
$val
){
if
(
$val
[
'family_id'
]
==
$family_id
){
array_push
(
$list
,
$val
);
}
}
}
else
{
foreach
(
$data
as
$key
=>
$val
){
$people
=
FamilyPeopleModel
::
dataInfo
([
'id'
=>
$val
[
'people_id'
],
'activation_code'
=>
$activation_code
]);
if
(
$people
){
array_push
(
$list
,
$val
);
}
}
}
$this
->
success
(
""
,
$list
);
}
}
}
}
...
...
application/api/controller/FamilyTree.php
View file @
df7a59b2
...
@@ -701,6 +701,20 @@ class FamilyTree extends Api
...
@@ -701,6 +701,20 @@ class FamilyTree extends Api
$this
->
success
(
"审核成功"
);
$this
->
success
(
"审核成功"
);
}
}
/**
* 我创建的族员
*/
public
function
myCreateFamilyPeople
(){
$page
=
$this
->
request
->
param
(
"page"
,
1
);
$skeyword
=
$this
->
request
->
param
(
"skeyword"
);
$where
=
" (ft.create_user_id = "
.
$this
->
auth
->
id
.
" OR ftm.create_user_id = "
.
$this
->
auth
->
id
.
") "
;
if
(
!
empty
(
$skeyword
)){
$where
=
$where
.
" AND fp.name like '%"
.
$skeyword
.
"'"
;
}
$list
=
FamilyPeopleModel
::
myCreateFamilyPeople
(
$where
,
$page
,
$this
->
pageSize
);
$this
->
success
(
""
,
$list
);
}
...
...
application/lib/model/FamilyPeopleModel.php
View file @
df7a59b2
...
@@ -83,5 +83,21 @@ class FamilyPeopleModel extends Model
...
@@ -83,5 +83,21 @@ class FamilyPeopleModel extends Model
return
self
::
where
(
$where
)
->
update
(
$data
);
return
self
::
where
(
$where
)
->
update
(
$data
);
}
}
/**
* 查询我创建的族员
*/
public
static
function
myCreateFamilyPeople
(
$where
,
$page
,
$pageSize
=
10
){
$data
=
self
::
alias
(
"fp"
)
->
join
(
"family_tree ft"
,
"ft.people_id=fp.id"
,
"LEFT"
)
->
join
(
"family_tree_mate ftm"
,
"ftm.people_id=fp.id"
,
"LEFT"
)
->
field
(
"fp.id,fp.name,fp.photo,fp.sex,fp.activation_code"
)
->
where
(
$where
)
->
page
(
$page
)
->
limit
(
$pageSize
)
->
order
(
"fp.id DESC"
)
->
select
();
return
$data
;
}
}
}
\ No newline at end of file
application/lib/model/NameCardModel.php
0 → 100644
View file @
df7a59b2
<?php
namespace
app\lib\model
;
use
think\Model
;
class
NameCardModel
extends
Model
{
// 表名
protected
$name
=
'name_card'
;
/**
* @功能说明:
*/
public
static
function
dataInfo
(
$where
){
return
self
::
where
(
$where
)
->
find
();
}
/**
* @功能说明:编辑
*/
public
static
function
dataUpdate
(
$where
,
$data
){
return
self
::
where
(
$where
)
->
update
(
$data
);
}
}
\ No newline at end of file
application/lib/service/FamilyTreeService.php
View file @
df7a59b2
...
@@ -56,7 +56,7 @@ class FamilyTreeService
...
@@ -56,7 +56,7 @@ class FamilyTreeService
}
else
{
}
else
{
$family_id
=
isset
(
$param
[
'family_id'
])
?
$param
[
'family_id'
]
:
$family_id
;
$family_id
=
isset
(
$param
[
'family_id'
])
?
$param
[
'family_id'
]
:
$family_id
;
if
(
!
empty
(
$family_id
))
FamilyModel
::
where
([
'id'
=>
$family_id
])
->
setInc
(
'join_number'
);
if
(
!
empty
(
$family_id
))
FamilyModel
::
where
([
'id'
=>
$family_id
])
->
setInc
(
'join_number'
);
$people
[
"activation_code"
]
=
create_randomstr
()
;
$people
[
"activation_code"
]
=
$people
[
'ext0'
]
==
0
?
create_randomstr
()
:
null
;
return
FamilyPeopleModel
::
dataAdd
(
$people
);
return
FamilyPeopleModel
::
dataAdd
(
$people
);
}
}
}
}
...
...
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