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
87aa56ee
Commit
87aa56ee
authored
Dec 03, 2024
by
lizhilin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
1fa3835e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
3 deletions
+32
-3
app/Admin/Controllers/LawyerCommissionCollectController.php
+3
-1
app/Admin/Repositories/LawyerCommission.php
+29
-2
No files found.
app/Admin/Controllers/LawyerCommissionCollectController.php
View file @
87aa56ee
...
...
@@ -31,7 +31,9 @@ protected function grid()
for
(
$i
=
1
;
$i
<=
$monthNum
;
$i
++
)
{
$grid
->
column
(
$i
,
$i
.
'月'
);
}
$grid
->
column
(
'total'
,
'合计'
);
$grid
->
column
(
'total'
,
'合计'
)
->
display
(
function
(
$val
)
{
return
$val
?
$val
:
''
;
});
// $grid->disableViewButton();
// $grid->disableCreateButton();
...
...
app/Admin/Repositories/LawyerCommission.php
View file @
87aa56ee
...
...
@@ -2,8 +2,9 @@
namespace
App\Admin\Repositories
;
use
App\Models\Lawyer
;
use
App\Models\Lawyer
as
ModelLawyer
;
use
App\Models\LawyerCost
as
ModelLawyerCost
;
use
App\Models\CovenantReceivePayment
as
ModelCovenantReceivePayment
;
//use Dcat\Admin\Repositories\EloquentRepository;
use
Dcat\Admin\Repositories\Repository
;
use
Dcat\Admin\Grid
;
...
...
@@ -29,6 +30,12 @@ public function get(Grid\Model $model)
// 获取筛选条件
$year
=
$model
->
filter
()
->
input
(
'year'
)
??
date
(
"Y"
);
$lnum
=
$model
->
filter
()
->
input
(
'no'
)
??
''
;
$lawyer_id
=
$commission_rate
=
0
;
if
(
$lnum
)
{
$larwerObj
=
ModelLawyer
::
where
(
'number'
,
$lnum
)
->
first
();
$lawyer_id
=
$larwerObj
->
id
;
$commission_rate
=
$larwerObj
->
commission_rate
;
}
$data
=
[];
$nowyear
=
date
(
'Y'
);
...
...
@@ -48,6 +55,24 @@ public function get(Grid\Model $model)
$tmp
[
$i
]
=
'0.00'
;
$condition
=
[
'year'
=>
$year
,
'month'
=>
$i
,
'number'
=>
$lnum
];
//创收收款
$receiveMoeny
=
ModelCovenantReceivePayment
::
getReceivedMoney
(
$lawyer_id
,
$year
,
$i
);
if
(
$val
[
'field'
]
==
'received_money'
)
{
$tmp
[
$i
]
=
ModelCovenantReceivePayment
::
getReceivedMoney
(
$lawyer_id
,
$year
,
$i
);
}
//提成比例
if
(
$val
[
'field'
]
==
'commission_rate'
)
{
$tmp
[
$i
]
=
strval
(
$commission_rate
*
1
)
.
'%'
;
}
//可提成金额
if
(
$val
[
'field'
]
==
'royalty_amount'
)
{
$tmp
[
$i
]
=
sprintf
(
'%.2f'
,
$receiveMoeny
*
(
$commission_rate
/
100
));
}
//已支付款项
if
(
$val
[
'field'
]
==
'paid_amount'
)
{
$paid_amount
=
ModelLawyerCost
::
getPaidAmount
(
$lawyer_id
,
$year
,
$i
);
$tmp
[
$i
]
=
sprintf
(
'%.2f'
,
$paid_amount
);
}
//基本工资
if
(
$val
[
'field'
]
==
'basic_salary'
)
{
$basic_salary
=
ModelLawyerCost
::
where
(
$condition
)
->
sum
(
'basic_salary'
);
...
...
@@ -131,7 +156,9 @@ public function get(Grid\Model $model)
}
//总计
$tmp
[
'total'
]
+=
$tmp
[
$i
];
if
(
$val
[
'field'
]
!=
'commission_rate'
)
{
$tmp
[
'total'
]
+=
$tmp
[
$i
];
}
}
$data
[
$key
]
=
$tmp
;
...
...
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