Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lvsuo-pc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhilin
lvsuo-pc
Commits
9dd72064
Commit
9dd72064
authored
Dec 06, 2024
by
lizhilin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
584bad92
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
31 deletions
+23
-31
app/Admin/Controllers/LawyerCommissionController.php
+1
-1
app/Models/LawyerCost.php
+22
-30
No files found.
app/Admin/Controllers/LawyerCommissionController.php
View file @
9dd72064
...
...
@@ -36,7 +36,7 @@ protected function grid()
return
sprintf
(
'%.2f'
,
$paid_amount
);
});
$grid
->
column
(
'posting_tickets_money'
,
'贴票金额'
)
->
display
(
function
()
use
(
$year
)
{
$tickets_money
=
ModelLawyerCost
::
get
PostingTicketsMoney
(
$this
->
id
,
$year
,
$this
->
commission_rate
,
$this
->
ticket_ratio
);
$tickets_money
=
ModelLawyerCost
::
get
AllPostingTicketsMoney
(
$this
->
id
,
$year
);
return
$tickets_money
;
});
$grid
->
column
(
'commission_retention'
,
'预留结案费'
)
->
display
(
function
()
use
(
$year
)
{
...
...
app/Models/LawyerCost.php
View file @
9dd72064
...
...
@@ -223,40 +223,32 @@ public static function getPostingTicketsMoney($lawyer_id, $year, $commission_rat
public
static
function
getAllPostingTicketsMoney
(
$lawyer_id
,
$year
)
{
$total
=
0
;
$where
=
[];
if
(
$lawyer_id
)
{
$where
[
'id'
]
=
$lawyer_id
;
}
$result
=
DB
::
table
(
'lawyer'
)
->
select
([
'id'
,
'number'
,
'commission_rate'
,
'ticket_ratio'
])
->
where
(
$where
)
->
limit
(
1500
)
->
get
();
if
(
$result
->
toArray
())
{
foreach
(
$result
as
$item
)
{
$lawyer_id
=
$item
->
id
;
$commission_rate
=
$item
->
commission_rate
;
$ticket_ratio
=
$item
->
ticket_ratio
;
$ticket
=
0
;
$received_money
=
CovenantReceivePayment
::
getReceivedMoney
(
$lawyer_id
,
$year
);
//创收已收款
$paid_amount
=
LawyerCost
::
getPaidAmount
(
$lawyer_id
,
$year
);
//已支付款项
$commission
=
$received_money
*
(
$commission_rate
/
100
);
//提成
if
(
$commission_rate
==
80
)
{
if
(
$commission
>
300000
)
{
$ticket
=
(
$commission
-
$paid_amount
)
*
(
$ticket_ratio
/
100
);
}
}
elseif
(
$commission_rate
==
85
)
{
if
(
$commission
>
200000
)
{
$ticket
=
(
$commission
-
$paid_amount
)
*
(
$ticket_ratio
/
100
);
}
}
elseif
(
$commission_rate
==
88
||
$commission_rate
==
90
)
{
if
(
$commission
>
120000
)
{
$ticket
=
(
$commission
-
$paid_amount
)
*
(
$ticket_ratio
/
100
);
}
$lawyerObj
=
Lawyer
::
find
(
$lawyer_id
);
$commission_rate
=
$lawyerObj
->
commission_rate
;
$ticket_ratio
=
$lawyerObj
->
ticket_ratio
;
$monthArr
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
];
foreach
(
$monthArr
as
$m
)
{
$ticket
=
0
;
$received_money
=
CovenantReceivePayment
::
getReceivedMoney
(
$lawyer_id
,
$year
,
$m
);
//创收已收款
$paid_amount
=
LawyerCost
::
getPaidAmount
(
$lawyer_id
,
$year
,
$m
);
//已支付款项
$commission
=
$received_money
*
(
$commission_rate
/
100
);
//提成
if
(
$commission_rate
==
80
)
{
if
(
$commission
>
300000
)
{
$ticket
=
(
$commission
-
$paid_amount
)
*
(
$ticket_ratio
/
100
);
}
}
elseif
(
$commission_rate
==
85
)
{
if
(
$commission
>
200000
)
{
$ticket
=
(
$commission
-
$paid_amount
)
*
(
$ticket_ratio
/
100
);
}
}
elseif
(
$commission_rate
==
88
||
$commission_rate
==
90
)
{
if
(
$commission
>
120000
)
{
$ticket
=
(
$commission
-
$paid_amount
)
*
(
$ticket_ratio
/
100
);
}
$total
+=
$ticket
;
}
$total
+=
$ticket
;
}
return
$total
;
}
...
...
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