Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
b0052bde
Commit
b0052bde
authored
Sep 19, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
排序验证
parent
195ba5e9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
0 deletions
+39
-0
Performance.php
application/index/controller/Performance.php
+4
-0
PerformanceService.php
application/index/service/PerformanceService.php
+6
-0
PerformanceServiceValidate.php
application/index/validate/PerformanceServiceValidate.php
+29
-0
No files found.
application/index/controller/Performance.php
View file @
b0052bde
...
@@ -68,6 +68,10 @@ class Performance extends Basic
...
@@ -68,6 +68,10 @@ class Performance extends Basic
"end_day" => "",
"end_day" => "",
"start_day" =>"",
"start_day" =>"",
);*/
);*/
$checkResult
=
$this
->
validate
(
$params
,
"PerformanceServiceValidate.selectDistrictPerformance"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
101
,
$checkResult
);
}
$params
[
"type"
]
=
3
;
$params
[
"type"
]
=
3
;
...
...
application/index/service/PerformanceService.php
View file @
b0052bde
...
@@ -97,7 +97,13 @@ class PerformanceService
...
@@ -97,7 +97,13 @@ class PerformanceService
sum(add_house_num) as add_house_num_total,
sum(add_house_num) as add_house_num_total,
sum(add_user_num) as add_user_num_total
sum(add_user_num) as add_user_num_total
"
;
"
;
//排序规则
if
(
!
empty
(
$params
[
'order'
]))
{
$order
=
"performance_total "
.
$params
[
'order'
];
}
else
{
$order
=
"performance_total desc"
;
$order
=
"performance_total desc"
;
}
$result
=
$this
->
totalModel
->
getTotalByAgentIdForPcPerformance
(
$field
,
$where_
,
$type
,
$order
,
$pageSize
,
$pageNo
);
$result
=
$this
->
totalModel
->
getTotalByAgentIdForPcPerformance
(
$field
,
$where_
,
$type
,
$order
,
$pageSize
,
$pageNo
);
$total_result
=
$this
->
totalModel
->
getTotalByAgentIdForPcPerformanceTotal
(
$field
,
$where_
,
$type
);
$total_result
=
$this
->
totalModel
->
getTotalByAgentIdForPcPerformanceTotal
(
$field
,
$where_
,
$type
);
...
...
application/index/validate/PerformanceServiceValidate.php
0 → 100644
View file @
b0052bde
<?php
namespace
app\index\validate
;
use
think\Validate
;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2018-09-19
* Time: 上午10:58:12
*/
class
PerformanceServiceValidate
extends
Validate
{
protected
$rule
=
[
'order'
=>
'require|in:desc,asc'
,
];
protected
$message
=
[
'order.require'
=>
'排序必传'
,
'order.in'
=>
'排序只能为desc或asc'
,
];
protected
$scene
=
[
'selectDistrictPerformance'
=>
[
'order'
],
];
}
\ No newline at end of file
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