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
58443b6d
Commit
58443b6d
authored
Jan 09, 2024
by
sugar
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://rungit.jxdsy.cn:10000/sugar/zhupu
into dev
parents
b41919ad
6377dc79
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
114 additions
and
5 deletions
+114
-5
application/api/controller/Family.php
application/api/controller/Family.php
+30
-1
application/lib/model/FamilyAreaModel.php
application/lib/model/FamilyAreaModel.php
+17
-0
application/lib/model/FamilyFenBuModel.php
application/lib/model/FamilyFenBuModel.php
+17
-0
application/lib/model/FamilyInfoModel.php
application/lib/model/FamilyInfoModel.php
+36
-0
application/lib/service/PaymentService.php
application/lib/service/PaymentService.php
+14
-4
No files found.
application/api/controller/Family.php
View file @
58443b6d
...
...
@@ -11,6 +11,9 @@ use app\api\model\RechargeModel;
use
app\api\model\UsersModel
;
use
app\common\controller\Api
;
use
app\lib\model\AgentModel
;
use
app\lib\model\FamilyAreaModel
;
use
app\lib\model\FamilyFenBuModel
;
use
app\lib\model\FamilyInfoModel
;
use
app\lib\model\FamilyModel
;
use
app\lib\model\FamilyPeopleModel
;
use
app\lib\model\FamilyTreeMateModel
;
...
...
@@ -57,7 +60,7 @@ class Family extends Api
}
else
if
(
$people
&&
$people
[
'user_id'
]){
$this
->
error
(
"该成员已被账户关联"
);
}
if
(
$people
[
'is_pay'
]
==
0
){
if
(
$people
[
'is_pay'
]
==
0
&&
$type
!=
2
){
$this
->
error
(
"请激活!"
,
$people
,
9999
);
}
$res
=
FamilyPeopleModel
::
dataUpdate
([
'id'
=>
$people_id
],[
'user_id'
=>
$this
->
auth
->
id
,
'fastim_id'
=>
$fastim_id
]);
...
...
@@ -456,4 +459,30 @@ class Family extends Api
$this
->
success
(
"获取成功"
,[
'info'
=>
$info
]);
}
/**
* 姓氏分布图
*/
public
function
surnameDistribute
(){
$page
=
$this
->
request
->
param
(
"page"
,
1
);
$list
=
FamilyInfoModel
::
dataList
([],
"*"
,
$page
);
foreach
(
$list
as
$key
=>
$val
){
$list
[
$key
][
'area'
]
=
FamilyAreaModel
::
where
([
'family_card_id'
=>
$val
[
'id'
]])
->
select
();
$list
[
$key
][
'nationality'
]
=
FamilyFenBuModel
::
where
([
'family_card_id'
=>
$val
[
'id'
]])
->
select
();
}
$this
->
success
(
$list
);
}
public
function
surnameDistributeDetail
(){
$id
=
$this
->
request
->
param
(
"id"
);
if
(
empty
(
$id
)){
$this
->
error
(
"该参数有误"
);
}
$data
=
FamilyInfoModel
::
dataInfo
([
'id'
=>
$id
]);
$data
[
'area'
]
=
FamilyAreaModel
::
where
([
'family_card_id'
=>
$data
[
'id'
]])
->
select
();
$data
[
'nationality'
]
=
FamilyFenBuModel
::
where
([
'family_card_id'
=>
$data
[
'id'
]])
->
select
();
$this
->
success
(
$data
);
}
}
\ No newline at end of file
application/lib/model/FamilyAreaModel.php
0 → 100644
View file @
58443b6d
<?php
namespace
app\lib\model
;
use
think\Model
;
class
FamilyAreaModel
extends
Model
{
// 姓氏分布表
protected
$name
=
'family_area'
;
}
\ No newline at end of file
application/lib/model/FamilyFenBuModel.php
0 → 100644
View file @
58443b6d
<?php
namespace
app\lib\model
;
use
think\Model
;
class
FamilyFenBuModel
extends
Model
{
// 姓氏分布表
protected
$name
=
'family_fenbu'
;
}
\ No newline at end of file
application/lib/model/FamilyInfoModel.php
0 → 100644
View file @
58443b6d
<?php
namespace
app\lib\model
;
use
think\Model
;
class
FamilyInfoModel
extends
Model
{
// 姓氏分布表
protected
$name
=
'family_info'
;
/**
* @功能说明:
*/
public
static
function
dataInfo
(
$where
){
$data
=
self
::
where
(
$where
)
->
find
();
return
$data
;
}
/**
* 查询列表
*/
public
static
function
dataList
(
$where
,
$field
=
"*"
,
$page
=
1
,
$pagesize
=
15
,
$order
=
"id DESC"
){
$data
=
self
::
where
(
$where
)
->
field
(
$field
)
->
page
(
$page
)
->
limit
(
$pagesize
)
->
order
(
$order
)
->
select
();
return
$data
;
}
}
\ No newline at end of file
application/lib/service/PaymentService.php
View file @
58443b6d
...
...
@@ -25,29 +25,39 @@ class PaymentService
return
false
;
}
$inheritor_rate
=
0
;
foreach
(
$inheritor
as
$key
=>
$val
){
//族长,传承人分佣
UsersModel
::
addCommission
(
$val
[
'user_id'
],
$pay_log
[
'need_pay'
]
*
$val
[
'rate'
],
50
,
2
,
"加入族谱分佣"
,
0
,
$pay_log
[
'id'
],
$pay_log
[
'order_type'
],
$pay_log
[
'pay_way'
],
$pay_log
[
'order_id'
],
null
,
null
);
$inheritor_rate
+=
$val
[
'rate'
];
}
//区县代理分佣
$area
=
AgentModel
::
dataInfo
([
'area_id'
=>
$family
[
'area_id'
],
'type'
=>
3
,
'status'
=>
1
]);
if
(
$area
){
UsersModel
::
addCommission
(
$area
[
'user_id'
],
$pay_log
[
'need_pay'
]
*
$area
[
'rate'
],
50
,
2
,
"加入族谱区县代理分佣"
,
0
,
$area_rate
=
$inheritor
?
$area
[
'rate'
]
:
$area
[
'rate'
]
+
$inheritor_rate
;
UsersModel
::
addCommission
(
$area
[
'user_id'
],
$pay_log
[
'need_pay'
]
*
$area_rate
,
50
,
2
,
"加入族谱区县代理分佣"
,
0
,
$pay_log
[
'id'
],
$pay_log
[
'order_type'
],
$pay_log
[
'pay_way'
],
$pay_log
[
'order_id'
],
null
,
null
);
}
//市级代理分佣
$city
=
AgentModel
::
dataInfo
([
'city_id'
=>
$family
[
'city_id'
],
'type'
=>
4
,
'status'
=>
1
]);
if
(
$city
){
UsersModel
::
addCommission
(
$city
[
'user_id'
],
$pay_log
[
'need_pay'
]
*
$city
[
'rate'
],
50
,
2
,
"加入族谱市级代理分佣"
,
0
,
$city_rate
=
$city
[
'rate'
];
if
(
$inheritor
){
$city_rate
+=
$inheritor_rate
;
}
if
(
$area
){
$city_rate
+=
$area
[
'rate'
];
}
UsersModel
::
addCommission
(
$city
[
'user_id'
],
$pay_log
[
'need_pay'
]
*
$city_rate
,
50
,
2
,
"加入族谱市级代理分佣"
,
0
,
$pay_log
[
'id'
],
$pay_log
[
'order_type'
],
$pay_log
[
'pay_way'
],
$pay_log
[
'order_id'
],
null
,
null
);
}
//省级代理分佣
$province
=
AgentModel
::
dataInfo
([
'province_id'
=>
$family
[
'province_id'
],
'type'
=>
5
,
'status'
=>
1
]);
/*
$province=AgentModel::dataInfo(['province_id'=>$family['province_id'],'type'=>5,'status'=>1]);
if($province){
UsersModel::addCommission($province['user_id'],$pay_log['need_pay']*$province['rate'],50,2,"加入族谱省级代理分佣",0,
$pay_log['id'],$pay_log['order_type'],$pay_log['pay_way'],$pay_log['order_id'],null,null);
}
}
*/
return
true
;
}
...
...
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