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
b289e9fa
Commit
b289e9fa
authored
Jan 03, 2024
by
wuxiaoli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代理分佣模式
parent
5f7a9840
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
application/api/controller/Family.php
application/api/controller/Family.php
+1
-1
application/lib/service/PaymentService.php
application/lib/service/PaymentService.php
+8
-4
No files found.
application/api/controller/Family.php
View file @
b289e9fa
...
@@ -57,7 +57,7 @@ class Family extends Api
...
@@ -57,7 +57,7 @@ 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
){
if
(
$people
[
'is_pay'
]
==
0
&&
$type
!=
2
){
$this
->
error
(
"请激活!"
,
$people
,
9999
);
$this
->
error
(
"请激活!"
,
$people
,
9999
);
}
}
$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
]);
...
...
application/lib/service/PaymentService.php
View file @
b289e9fa
...
@@ -25,29 +25,33 @@ class PaymentService
...
@@ -25,29 +25,33 @@ class PaymentService
return
false
;
return
false
;
}
}
$inheritor_rate
=
0
;
foreach
(
$inheritor
as
$key
=>
$val
){
//族长,传承人分佣
foreach
(
$inheritor
as
$key
=>
$val
){
//族长,传承人分佣
UsersModel
::
addCommission
(
$val
[
'user_id'
],
$pay_log
[
'need_pay'
]
*
$val
[
'rate'
],
50
,
2
,
"加入族谱分佣"
,
0
,
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
);
$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
]);
$area
=
AgentModel
::
dataInfo
([
'area_id'
=>
$family
[
'area_id'
],
'type'
=>
3
,
'status'
=>
1
]);
if
(
$area
){
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
);
$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
]);
$city
=
AgentModel
::
dataInfo
([
'city_id'
=>
$family
[
'city_id'
],
'type'
=>
4
,
'status'
=>
1
]);
if
(
$city
){
if
(
$city
){
UsersModel
::
addCommission
(
$city
[
'user_id'
],
$pay_log
[
'need_pay'
]
*
$city
[
'rate'
],
50
,
2
,
"加入族谱市级代理分佣"
,
0
,
$city_rate
=
$area
?
$city
[
'rate'
]
:
$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
);
$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){
if($province){
UsersModel::addCommission($province['user_id'],$pay_log['need_pay']*$province['rate'],50,2,"加入族谱省级代理分佣",0,
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);
$pay_log['id'],$pay_log['order_type'],$pay_log['pay_way'],$pay_log['order_id'],null,null);
}
}
*/
return
true
;
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