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
46930de9
Commit
46930de9
authored
Dec 23, 2024
by
lizhilin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
98b6239e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
154 additions
and
127 deletions
+154
-127
app/Admin/Controllers/LawyerCostController.php
+56
-21
app/Admin/Controllers/LawyerCostListController.php
+55
-23
app/Admin/Repositories/Covenant.php
+43
-83
No files found.
app/Admin/Controllers/LawyerCostController.php
View file @
46930de9
...
@@ -62,7 +62,7 @@ protected function grid()
...
@@ -62,7 +62,7 @@ protected function grid()
return
self
::
getPersonalIncomeTax
(
$this
->
number
,
$year
);
return
self
::
getPersonalIncomeTax
(
$this
->
number
,
$year
);
});
});
if
(
!
Admin
::
user
()
->
can
(
'lawyer_cost_add'
))
{
if
(
!
Admin
::
user
()
->
can
(
'lawyer_cost_add'
)
||
!
Admin
::
user
()
->
can
(
'lawyer_cost_list_edit'
)
)
{
$grid
->
disableCreateButton
();
$grid
->
disableCreateButton
();
}
}
$grid
->
disableViewButton
();
$grid
->
disableViewButton
();
...
@@ -206,26 +206,47 @@ protected function form()
...
@@ -206,26 +206,47 @@ protected function form()
{
{
$form
=
Form
::
make
(
new
ModelLawyerCost
(),
function
(
Form
$form
)
{
$form
=
Form
::
make
(
new
ModelLawyerCost
(),
function
(
Form
$form
)
{
$form
->
display
(
'id'
);
$form
->
display
(
'id'
);
$form
->
text
(
'year'
)
->
default
(
date
(
'Y'
));
if
(
Admin
::
user
()
->
can
(
'lawyer_cost_list_edit'
))
{
$form
->
select
(
'month'
)
->
options
(
ModelLawyerCost
::
MONTH
)
->
required
();
$form
->
text
(
'year'
)
->
default
(
date
(
'Y'
));
$form
->
text
(
'number'
)
->
required
();
$form
->
select
(
'month'
)
->
options
(
ModelLawyerCost
::
MONTH
)
->
required
();
$form
->
text
(
'lname'
)
->
required
();
$form
->
text
(
'number'
)
->
required
();
$form
->
text
(
'basic_salary'
)
->
required
();
$form
->
text
(
'lname'
)
->
required
();
$form
->
text
(
'special_additional'
)
->
required
();
$form
->
text
(
'basic_salary'
)
->
required
();
$form
->
text
(
'social_person_fee'
)
->
required
();
$form
->
text
(
'special_additional'
)
->
required
();
$form
->
text
(
'social_company_fee'
)
->
required
();
$form
->
text
(
'social_person_fee'
)
->
required
();
$form
->
text
(
'social'
,
'社保'
)
->
readOnly
();
$form
->
text
(
'social_company_fee'
)
->
required
();
$form
->
text
(
'accumulation_fund_person_fee'
)
->
required
();
$form
->
text
(
'social'
,
'社保'
)
->
readOnly
();
$form
->
text
(
'accumulation_fund_company_fee'
)
->
required
();
$form
->
text
(
'accumulation_fund_person_fee'
)
->
required
();
$form
->
text
(
'accumulation_fund'
,
'公积金'
)
->
readOnly
();
$form
->
text
(
'accumulation_fund_company_fee'
)
->
required
();
$form
->
text
(
'annual_inspection_fee'
)
->
required
();
$form
->
text
(
'accumulation_fund'
,
'公积金'
)
->
readOnly
();
$form
->
text
(
'annuity'
)
->
required
();
$form
->
text
(
'annual_inspection_fee'
)
->
readOnly
();
$form
->
text
(
'assistant_fee'
)
->
required
();
$form
->
text
(
'annuity'
)
->
readOnly
();
$form
->
text
(
'office_rental_fee'
)
->
required
();
$form
->
text
(
'assistant_fee'
)
->
readOnly
();
$form
->
text
(
'noticket_cost'
)
->
readOnly
();
$form
->
text
(
'office_rental_fee'
)
->
readOnly
();
//$form->text('posting_tickets_fee');
$form
->
text
(
'noticket_cost'
)
->
readOnly
();
$form
->
text
(
'advance_fee'
);
$form
->
text
(
'advance_fee'
)
->
readOnly
();
$form
->
text
(
'personal_income_tax'
)
->
required
();
$form
->
text
(
'personal_income_tax'
)
->
readOnly
();
}
else
{
$form
->
text
(
'year'
)
->
default
(
date
(
'Y'
))
->
readOnly
();
$form
->
select
(
'month'
)
->
options
(
ModelLawyerCost
::
MONTH
)
->
readOnly
();
$form
->
text
(
'number'
)
->
readOnly
();
$form
->
text
(
'lname'
)
->
readOnly
();
$form
->
text
(
'basic_salary'
)
->
readOnly
();
$form
->
text
(
'special_additional'
)
->
readOnly
();
$form
->
text
(
'social_person_fee'
)
->
readOnly
();
$form
->
text
(
'social_company_fee'
)
->
readOnly
();
$form
->
text
(
'social'
,
'社保'
)
->
readOnly
();
$form
->
text
(
'accumulation_fund_person_fee'
)
->
readOnly
();
$form
->
text
(
'accumulation_fund_company_fee'
)
->
readOnly
();
$form
->
text
(
'accumulation_fund'
,
'公积金'
)
->
readOnly
();
$form
->
text
(
'annual_inspection_fee'
)
->
required
();
$form
->
text
(
'annuity'
)
->
required
();
$form
->
text
(
'assistant_fee'
)
->
required
();
$form
->
text
(
'office_rental_fee'
)
->
required
();
$form
->
text
(
'noticket_cost'
)
->
readOnly
();
$form
->
text
(
'advance_fee'
);
$form
->
text
(
'personal_income_tax'
)
->
required
();
}
$form
->
disableCreatingCheck
();
$form
->
disableCreatingCheck
();
$form
->
disableEditingCheck
();
$form
->
disableEditingCheck
();
...
@@ -278,6 +299,20 @@ protected function form()
...
@@ -278,6 +299,20 @@ protected function form()
JS
JS
);
);
$form
->
submitted
(
function
(
Form
$form
)
{
$number
=
isset
(
$_POST
[
'number'
])
?
$_POST
[
'number'
]
:
''
;
$month
=
isset
(
$_POST
[
'month'
])
?
$_POST
[
'month'
]
:
0
;
$year
=
isset
(
$_POST
[
'year'
])
?
$_POST
[
'year'
]
:
0
;
$lawyer_id
=
DB
::
table
(
'lawyer'
)
->
where
(
'number'
,
$number
)
->
value
(
'id'
);
if
(
!
$number
||
!
$lawyer_id
)
{
$form
->
responseValidationMessages
(
'number'
,
"该律师信息不存在"
);
}
$exist
=
DB
::
table
(
'lawyer_cost'
)
->
where
([
'year'
=>
$year
,
'month'
=>
$month
,
'lawyer_id'
=>
$lawyer_id
])
->
value
(
'id'
);
if
(
$exist
)
{
$form
->
responseValidationMessages
(
'month'
,
"当前月份成本信息已存在"
);
}
});
//副表保存规格
//副表保存规格
$form
->
saved
(
$form
->
saved
(
function
(
Form
$form
,
$result
)
{
function
(
Form
$form
,
$result
)
{
...
...
app/Admin/Controllers/LawyerCostListController.php
View file @
46930de9
...
@@ -53,6 +53,9 @@ protected function grid()
...
@@ -53,6 +53,9 @@ protected function grid()
$grid
->
column
(
'annuity'
,
'律所年金'
);
$grid
->
column
(
'annuity'
,
'律所年金'
);
$grid
->
column
(
'posting_tickets_fee'
,
'贴票成本'
)
->
display
(
function
()
use
(
$year
)
{
$grid
->
column
(
'posting_tickets_fee'
,
'贴票成本'
)
->
display
(
function
()
use
(
$year
)
{
$lawyerObj
=
ModelsLawyer
::
find
(
$this
->
lawyer_id
);
$lawyerObj
=
ModelsLawyer
::
find
(
$this
->
lawyer_id
);
if
(
!
$lawyerObj
)
{
return
0
;
}
return
ModelLawyerCost
::
getPostingTicketsMoney
(
$this
->
lawyer_id
,
$year
,
$lawyerObj
->
commission_rate
,
$lawyerObj
->
ticket_ratio
);
return
ModelLawyerCost
::
getPostingTicketsMoney
(
$this
->
lawyer_id
,
$year
,
$lawyerObj
->
commission_rate
,
$lawyerObj
->
ticket_ratio
);
});
});
$grid
->
column
(
'assistant_fee'
,
'助理律师成本'
);
$grid
->
column
(
'assistant_fee'
,
'助理律师成本'
);
...
@@ -64,7 +67,7 @@ protected function grid()
...
@@ -64,7 +67,7 @@ protected function grid()
$grid
->
disableViewButton
();
$grid
->
disableViewButton
();
$grid
->
disableCreateButton
();
$grid
->
disableCreateButton
();
$grid
->
disableRowSelector
();
$grid
->
disableRowSelector
();
if
(
!
Admin
::
user
()
->
can
(
'lawyer_cost_list_edit'
))
{
if
(
!
Admin
::
user
()
->
can
(
'lawyer_cost_list_edit'
)
&&
!
Admin
::
user
()
->
can
(
'lawyer_cost_list_cwedit'
)
)
{
$grid
->
disableEditButton
();
$grid
->
disableEditButton
();
}
}
if
(
!
Admin
::
user
()
->
can
(
'lawyer_cost_list_delete'
))
{
if
(
!
Admin
::
user
()
->
can
(
'lawyer_cost_list_delete'
))
{
...
@@ -134,28 +137,57 @@ protected function form()
...
@@ -134,28 +137,57 @@ protected function form()
{
{
$form
=
Form
::
make
(
new
ModelLawyerCost
(),
function
(
Form
$form
)
{
$form
=
Form
::
make
(
new
ModelLawyerCost
(),
function
(
Form
$form
)
{
$form
->
display
(
'id'
);
$form
->
display
(
'id'
);
$form
->
text
(
'year'
)
->
required
();
if
(
Admin
::
user
()
->
can
(
'lawyer_cost_list_edit'
))
{
$form
->
select
(
'month'
)
->
options
(
ModelLawyerCost
::
MONTH
);
$form
->
text
(
'year'
)
->
default
(
date
(
'Y'
));
$form
->
display
(
'number'
);
$form
->
select
(
'month'
)
->
options
(
ModelLawyerCost
::
MONTH
)
->
required
();
$form
->
text
(
'lname'
)
->
required
();
$form
->
text
(
'number'
)
->
required
();
$form
->
text
(
'basic_salary'
)
->
required
();
$form
->
text
(
'lname'
)
->
required
();
$form
->
text
(
'special_additional'
)
->
required
();
$form
->
text
(
'basic_salary'
)
->
required
();
$form
->
text
(
'social_person_fee'
)
->
required
();
$form
->
text
(
'special_additional'
)
->
required
();
$form
->
text
(
'social_company_fee'
)
->
required
();
$form
->
text
(
'social_person_fee'
)
->
required
();
//$social = $form->model()->social;
$form
->
text
(
'social_company_fee'
)
->
required
();
$form
->
text
(
'social'
,
'社保'
)
->
readOnly
();
$form
->
text
(
'social'
,
'社保'
)
->
readOnly
();
$form
->
text
(
'accumulation_fund_person_fee'
)
->
required
();
$form
->
text
(
'accumulation_fund_person_fee'
)
->
required
();
$form
->
text
(
'accumulation_fund_company_fee'
)
->
required
();
$form
->
text
(
'accumulation_fund_company_fee'
)
->
required
();
$form
->
text
(
'accumulation_fund'
,
'公积金'
)
->
readOnly
();
$form
->
text
(
'accumulation_fund'
,
'公积金'
)
->
readOnly
();
$form
->
text
(
'annual_inspection_fee'
)
->
required
();
$form
->
text
(
'annual_inspection_fee'
)
->
readOnly
();
$form
->
text
(
'annuity'
)
->
required
();
$form
->
text
(
'annuity'
)
->
readOnly
();
$form
->
text
(
'assistant_fee'
)
->
required
();
$form
->
text
(
'assistant_fee'
)
->
readOnly
();
$form
->
text
(
'office_rental_fee'
)
->
required
();
$form
->
text
(
'office_rental_fee'
)
->
readOnly
();
$form
->
text
(
'noticket_cost'
)
->
readOnly
();
$form
->
text
(
'noticket_cost'
)
->
readOnly
();
//$form->text('posting_tickets_fee');
$form
->
text
(
'advance_fee'
)
->
readOnly
();
$form
->
text
(
'advance_fee'
);
$form
->
text
(
'personal_income_tax'
)
->
readOnly
();
$form
->
text
(
'personal_income_tax'
)
->
required
();
}
else
{
$form
->
text
(
'year'
)
->
default
(
date
(
'Y'
))
->
readOnly
();
//$form->select('month')->options(ModelLawyerCost::MONTH)->disable();
// $form->select('month')
// ->options(ModelLawyerCost::MONTH)
// ->default(function () use ($form) {
// // 获取模型实例
// $model = $form->model();
// // 返回默认值,这里保留数据库中的值
// return $model->month;
// })
// ->readOnly();
$form
->
text
(
'month'
)
->
readOnly
();
$form
->
text
(
'number'
)
->
readOnly
();
$form
->
text
(
'lname'
)
->
readOnly
();
$form
->
text
(
'basic_salary'
)
->
readOnly
();
$form
->
text
(
'special_additional'
)
->
readOnly
();
$form
->
text
(
'social_person_fee'
)
->
readOnly
();
$form
->
text
(
'social_company_fee'
)
->
readOnly
();
$form
->
text
(
'social'
,
'社保'
)
->
readOnly
();
$form
->
text
(
'accumulation_fund_person_fee'
)
->
readOnly
();
$form
->
text
(
'accumulation_fund_company_fee'
)
->
readOnly
();
$form
->
text
(
'accumulation_fund'
,
'公积金'
)
->
readOnly
();
$form
->
text
(
'annual_inspection_fee'
)
->
required
();
$form
->
text
(
'annuity'
)
->
required
();
$form
->
text
(
'assistant_fee'
)
->
required
();
$form
->
text
(
'office_rental_fee'
)
->
required
();
$form
->
text
(
'noticket_cost'
)
->
readOnly
();
$form
->
text
(
'advance_fee'
);
$form
->
text
(
'personal_income_tax'
)
->
required
();
}
$form
->
disableCreatingCheck
();
$form
->
disableCreatingCheck
();
$form
->
disableEditingCheck
();
$form
->
disableEditingCheck
();
$form
->
disableViewCheck
();
$form
->
disableViewCheck
();
...
...
app/Admin/Repositories/Covenant.php
View file @
46930de9
...
@@ -94,6 +94,10 @@ public function getList(array $param)
...
@@ -94,6 +94,10 @@ public function getList(array $param)
if
(
$lawyer_id
)
{
if
(
$lawyer_id
)
{
$condition
[
'rp.lawyer_id'
]
=
$lawyer_id
;
$condition
[
'rp.lawyer_id'
]
=
$lawyer_id
;
}
}
DB
::
enableQueryLog
();
$note_monitor
=
DB
::
table
(
'covenant_receive_payment AS rp'
)
->
select
([
'rp.*'
,
'c.cname'
,
'c.ctype'
,
'c.number'
])
->
leftJoin
(
'covenant as c'
,
'rp.cid'
,
'='
,
'c.id'
);
if
(
$invoiced_at
[
'start'
]
&&
$received_at
[
'start'
])
{
if
(
$invoiced_at
[
'start'
]
&&
$received_at
[
'start'
])
{
$in_start
=
$invoiced_at
[
'start'
]
??
''
;
$in_start
=
$invoiced_at
[
'start'
]
??
''
;
$in_end
=
$invoiced_at
[
'end'
]
??
''
;
$in_end
=
$invoiced_at
[
'end'
]
??
''
;
...
@@ -101,71 +105,37 @@ public function getList(array $param)
...
@@ -101,71 +105,37 @@ public function getList(array $param)
$re_end
=
$received_at
[
'end'
]
??
''
;
$re_end
=
$received_at
[
'end'
]
??
''
;
if
(
$in_start
&&
$re_start
)
{
if
(
$in_start
&&
$re_start
)
{
if
(
$in_end
&&
$re_end
)
{
if
(
$in_end
&&
$re_end
)
{
$note_monitor
=
DB
::
table
(
'covenant_receive_payment AS rp'
)
$note_monitor
=
$note_monitor
->
whereBetween
(
'rp.received_at'
,
[
$re_start
,
$re_end
])
->
select
([
'rp.*'
,
'c.cname'
,
'c.ctype'
])
->
leftJoin
(
'covenant as c'
,
'rp.cid'
,
'='
,
'c.id'
)
->
whereBetween
(
'rp.received_at'
,
[
$re_start
,
$re_end
])
->
whereBetween
(
'rp.invoiced_at'
,
[
$in_start
,
$in_end
])
->
whereBetween
(
'rp.invoiced_at'
,
[
$in_start
,
$in_end
])
->
where
(
$condition
)
->
where
(
$condition
);
->
groupBy
(
'rp.cid'
);
}
else
{
}
else
{
if
(
$in_end
)
{
if
(
$in_end
)
{
$note_monitor
=
DB
::
table
(
'covenant_receive_payment AS rp'
)
$note_monitor
=
$note_monitor
->
whereDate
(
'rp.received_at'
,
'>'
,
$re_start
)
->
select
([
'rp.*'
,
'c.cname'
,
'c.ctype'
])
->
leftJoin
(
'covenant as c'
,
'rp.cid'
,
'='
,
'c.id'
)
->
whereDate
(
'rp.received_at'
,
'>'
,
$re_start
)
->
whereBetween
(
'rp.invoiced_at'
,
[
$in_start
,
$in_end
])
->
whereBetween
(
'rp.invoiced_at'
,
[
$in_start
,
$in_end
])
->
where
(
$condition
)
->
where
(
$condition
);
->
groupBy
(
'rp.cid'
);
}
elseif
(
$re_end
)
{
}
elseif
(
$re_end
)
{
$note_monitor
=
DB
::
table
(
'covenant_receive_payment AS rp'
)
$note_monitor
=
$note_monitor
->
whereDate
(
'rp.invoiced_at'
,
'>'
,
$in_start
)
->
select
([
'rp.*'
,
'c.cname'
,
'c.ctype'
])
->
leftJoin
(
'covenant as c'
,
'rp.cid'
,
'='
,
'c.id'
)
->
whereDate
(
'rp.invoiced_at'
,
'>'
,
$in_start
)
->
whereBetween
(
'rp.received_at'
,
[
$re_start
,
$re_end
])
->
whereBetween
(
'rp.received_at'
,
[
$re_start
,
$re_end
])
->
where
(
$condition
)
->
where
(
$condition
);
->
groupBy
(
'rp.cid'
);
}
else
{
}
else
{
$note_monitor
=
DB
::
table
(
'covenant_receive_payment AS rp'
)
$note_monitor
=
$note_monitor
->
whereDate
(
'rp.invoiced_at'
,
'>'
,
$in_start
)
->
select
([
'rp.*'
,
'c.cname'
,
'c.ctype'
])
->
leftJoin
(
'covenant as c'
,
'rp.cid'
,
'='
,
'c.id'
)
->
whereDate
(
'rp.invoiced_at'
,
'>'
,
$in_start
)
->
whereDate
(
'rp.received_at'
,
'>'
,
$re_start
)
->
whereDate
(
'rp.received_at'
,
'>'
,
$re_start
)
->
where
(
$condition
)
->
where
(
$condition
);
->
groupBy
(
'rp.cid'
);
}
}
}
}
}
}
// 计算列表总数
$count
=
$note_monitor
->
count
();
// 获取列表
$data
=
[];
$list
=
$note_monitor
->
limit
(
$prePage
)
->
offset
(
$start
)
->
orderBy
(
'rp.cid'
,
'desc'
)
->
get
()
->
toArray
();
}
elseif
(
$invoiced_at
[
'start'
]
&&
!
$received_at
[
'start'
])
{
//开票日期
}
elseif
(
$invoiced_at
[
'start'
]
&&
!
$received_at
[
'start'
])
{
//开票日期
$start
=
$invoiced_at
[
'start'
]
??
''
;
$start
=
$invoiced_at
[
'start'
]
??
''
;
$end
=
$invoiced_at
[
'end'
]
??
''
;
$end
=
$invoiced_at
[
'end'
]
??
''
;
if
(
$start
)
{
if
(
$start
)
{
if
(
$end
)
{
if
(
$end
)
{
$note_monitor
=
DB
::
table
(
'covenant_receive_payment AS rp'
)
$note_monitor
=
$note_monitor
->
whereBetween
(
'rp.received_at'
,
[
$start
,
$end
])
->
select
([
'rp.*'
,
'c.cname'
,
'c.ctype'
])
->
where
(
$condition
);
->
leftJoin
(
'covenant as c'
,
'rp.cid'
,
'='
,
'c.id'
)
->
whereBetween
(
'rp.received_at'
,
[
$start
,
$end
])
->
where
(
$condition
)
->
groupBy
(
'rp.cid'
);
}
else
{
}
else
{
$note_monitor
=
DB
::
table
(
"covenant_receive_payment as rp"
)
$note_monitor
=
$note_monitor
->
whereDate
(
'rp.received_at'
,
'>'
,
$start
)
->
select
([
'rp.*'
,
'c.cname'
,
'c.ctype'
])
->
where
(
$condition
);
->
leftJoin
(
'covenant as c'
,
'rp.cid'
,
'='
,
'c.id'
)
->
whereDate
(
'rp.received_at'
,
'>'
,
$start
)
->
where
(
$condition
)
->
groupBy
(
'rp.cid'
);
}
}
// 计算列表总数
$count
=
$note_monitor
->
count
();
// 获取列表
$data
=
[];
$list
=
$note_monitor
->
limit
(
$prePage
)
->
offset
(
$start
)
->
orderBy
(
'rp.cid'
,
'desc'
)
->
get
()
->
toArray
();
}
}
//
//
}
elseif
(
$received_at
[
'start'
]
&&
!
$invoiced_at
[
'start'
])
{
//收款日期
}
elseif
(
$received_at
[
'start'
]
&&
!
$invoiced_at
[
'start'
])
{
//收款日期
...
@@ -174,52 +144,42 @@ public function getList(array $param)
...
@@ -174,52 +144,42 @@ public function getList(array $param)
if
(
$start
)
{
if
(
$start
)
{
if
(
$end
)
{
if
(
$end
)
{
$note_monitor
=
DB
::
table
(
'covenant_receive_payment AS rp'
)
$note_monitor
=
$note_monitor
->
whereBetween
(
'rp.received_at'
,
[
$start
,
$end
])
->
select
([
'rp.*'
,
'c.cname'
,
'c.ctype'
])
->
where
(
$condition
);
->
leftJoin
(
'covenant as c'
,
'rp.cid'
,
'='
,
'c.id'
)
->
whereBetween
(
'rp.received_at'
,
[
$start
,
$end
])
->
where
(
$condition
)
->
groupBy
(
'rp.cid'
);
}
else
{
}
else
{
$note_monitor
=
DB
::
table
(
"covenant_receive_payment as rp"
)
$note_monitor
=
$note_monitor
->
whereDate
(
'rp.received_at'
,
'>'
,
$start
)
->
select
([
'rp.*'
,
'c.cname'
,
'c.ctype'
])
->
where
(
$condition
);
->
leftJoin
(
'covenant as c'
,
'rp.cid'
,
'='
,
'c.id'
)
->
whereDate
(
'rp.received_at'
,
'>'
,
$start
)
->
where
(
$condition
)
->
groupBy
(
'rp.cid'
);
}
}
// 计算列表总数
$count
=
$note_monitor
->
count
();
// 获取列表
$data
=
[];
$list
=
$note_monitor
->
limit
(
$prePage
)
->
offset
(
$start
)
->
orderBy
(
'rp.cid'
,
'desc'
)
->
get
()
->
toArray
();
}
}
else
{
//关键词搜索
$note_monitor
=
DB
::
table
(
'covenant'
)
->
select
([
'id as cid'
,
'number'
,
'cname'
,
'principal'
,
'ctype'
]);
if
(
$lawyer_id
)
{
$note_monitor
=
$note_monitor
->
where
(
"lawyer_id"
,
$lawyer_id
);
}
if
(
$number
)
{
$note_monitor
=
$note_monitor
->
where
(
"number"
,
$number
);
}
if
(
$cname
)
{
$note_monitor
=
$note_monitor
->
where
(
"cname"
,
$cname
);
}
if
(
$principal
)
{
$note_monitor
=
$note_monitor
->
where
(
"principal"
,
$principal
);
}
}
// 计算列表总数
}
$count
=
$note_monitor
->
count
();
// 获取列表
if
(
$number
)
{
$data
=
[];
$note_monitor
=
$note_monitor
->
having
(
"number"
,
$number
);
$list
=
$note_monitor
->
limit
(
$prePage
)
->
offset
(
$start
)
->
get
()
->
toArray
();
}
if
(
$principal
)
{
$note_monitor
=
$note_monitor
->
having
(
"principal"
,
$principal
);
}
if
(
$cname
)
{
$note_monitor
=
$note_monitor
->
having
(
"cname"
,
$cname
);
}
// 计算列表总数
$count
=
0
;
//$note_monitor->count();
$cObj
=
$note_monitor
->
groupBy
(
'rp.cid'
)
->
get
();
if
(
$cObj
->
toArray
())
{
$count
=
count
(
$cObj
->
toArray
());
}
}
// 获取列表
$data
=
[];
$list
=
$note_monitor
->
limit
(
$prePage
)
->
offset
(
$start
)
->
orderBy
(
'rp.cid'
,
'desc'
)
->
get
()
->
toArray
();
$queries
=
DB
::
getQueryLog
();
// echo "<pre>";
// print_r($queries);
// die;
foreach
(
$list
as
$key
=>
$item
)
{
foreach
(
$list
as
$key
=>
$item
)
{
$tmp
=
[];
$tmp
=
[];
$tmp
[
'cid'
]
=
$item
->
cid
;
$tmp
[
'cid'
]
=
$item
->
cid
;
//
$tmp['number'] = $item->number;
$tmp
[
'number'
]
=
$item
->
number
;
$tmp
[
'cname'
]
=
$item
->
cname
;
$tmp
[
'cname'
]
=
$item
->
cname
;
$tmp
[
'ctype'
]
=
$item
->
ctype
;
$tmp
[
'ctype'
]
=
$item
->
ctype
;
$tmp
[
'principal'
]
=
$item
->
principal
;
$tmp
[
'principal'
]
=
$item
->
principal
;
...
...
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