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
aa09b17d
Commit
aa09b17d
authored
Oct 11, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Validate 验证
parent
625eb86c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
17 deletions
+55
-17
OperationData.php
application/index/controller/OperationData.php
+8
-17
OperationDataValidate.php
application/index/validate/OperationDataValidate.php
+45
-0
TAgentTotalModel.php
application/model/TAgentTotalModel.php
+2
-0
No files found.
application/index/controller/OperationData.php
View file @
aa09b17d
...
...
@@ -357,6 +357,12 @@ class OperationData extends Basic
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
$checkResult
=
$this
->
validate
(
$params
,
"OperationDataValidate.performanceStatistics"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
}
$time_start
=
$params
[
'time_start'
];
$time_end
=
$params
[
'time_end'
];
...
...
@@ -401,10 +407,9 @@ class OperationData extends Basic
}
else
{
$conditions
[
'site_id'
]
=
$v
[
'site_id'
];
}
$conditions
[
'site_id'
]
=
$v
[
'site_id'
];
$conditions
[
'create_time'
]
=
array
(
'between'
,
array
(
$p_start
.
" 00:00:00"
,
$p_end
.
" 23:59:59"
)
);
$performanceSum
=
$m_total
->
performanceStatistics
(
$conditions
,
1
);
$value_
[
'performance'
]
=
isset
(
$performanceSum
[
0
][
"
num"
])
?
$performanceSum
[
0
][
"num
"
]
:
0
;
$value_
[
'performance'
]
=
isset
(
$performanceSum
[
0
][
"
performance_total"
])
?
$performanceSum
[
0
][
"performance_total
"
]
:
0
;
// 实收
...
...
@@ -414,10 +419,9 @@ class OperationData extends Basic
}
else
{
$conditions
[
'site_id'
]
=
$v
[
'site_id'
];
}
$conditions
[
'site_id'
]
=
$v
[
'site_id'
];
$conditions
[
'create_time'
]
=
array
(
'between'
,
array
(
$r_p_start
.
" 00:00:00"
,
$r_p__end
.
" 23:59:59"
)
);
$real_performanceSum
=
$m_total
->
performanceStatistics
(
$conditions
,
2
);
$value_
[
'real_performance'
]
=
isset
(
$real_performanceSum
[
0
][
"
num"
])
?
$real_performanceSum
[
0
][
"num
"
]
:
0
;
$value_
[
'real_performance'
]
=
isset
(
$real_performanceSum
[
0
][
"
official_receipts_total"
])
?
$real_performanceSum
[
0
][
"official_receipts_total
"
]
:
0
;
//人数
...
...
@@ -443,19 +447,6 @@ class OperationData extends Basic
return
$this
->
response
(
200
,
'success'
,
$return
);
}
function
sum
(
$date
)
{
// $performance_count = 0;
// $real_performance_count = [];
$people_num_count
=
[];
foreach
(
$date
as
$key
=>
$v
)
{
foreach
(
$v
[
'value'
]
as
$month_key
=>
$month_v
)
{
$people_num_count
[
'people_num'
][]
=
[
'index'
=>
$month_key
,
'val'
=>
$month_v
[
'people_num'
]];
}
}
dump
(
$people_num_count
);
return
$date
;
}
/**
* 找出两个日期之间的所有的月份
...
...
application/index/validate/OperationDataValidate.php
0 → 100755
View file @
aa09b17d
<?php
namespace
app\index\validate
;
use
think\Validate
;
class
OperationDataValidate
extends
Validate
{
protected
$rule
=
[
'time_start'
=>
'require'
,
'time_end'
=>
'require'
,
'performance_time_start'
=>
'require|number|gt:0'
,
'performance_time_end'
=>
'require|number|gt:0'
,
'real_performance_time_start'
=>
'require|number|gt:0'
,
'real_performance_time_end'
=>
'require|number|gt:0'
,
];
protected
$message
=
[
'time_start.require'
=>
'time_start 不能为空'
,
'time_end.require'
=>
'time_end 不能为空'
,
'performance_time_start.require'
=>
'performance_time_start 不能为空'
,
'performance_time_end.require'
=>
'performance_time_end 不能为空'
,
'real_performance_time_start.require'
=>
'real_performance_time_start 不能为空'
,
'real_performance_time_end.require'
=>
'real_performance_time_end 不能为空'
,
'performance_time_start.number'
=>
'performance_time_start 必须为数字'
,
'performance_time_end.number'
=>
'performance_time_end 必须为数字'
,
'real_performance_time_start.number'
=>
'real_performance_time_start 必须为数字'
,
'real_performance_time_end.number'
=>
'real_performance_time_end 必须为数字'
,
'performance_time_start.gt'
=>
'performance_time_start 必须大于0'
,
'performance_time_end.gt'
=>
'performance_time_end 必须大于0'
,
'real_performance_time_start.gt'
=>
'real_performance_time_start 必须大于0'
,
'real_performance_time_end.gt'
=>
'real_performance_time_end 必须大于0'
,
];
protected
$scene
=
[
'performanceStatistics'
=>
[
'time_start'
,
'time_end'
,
'performance_time_start'
,
'performance_time_end'
,
'real_performance_time_start'
,
'real_performance_time_end'
],
];
}
\ No newline at end of file
application/model/TAgentTotalModel.php
View file @
aa09b17d
...
...
@@ -378,6 +378,7 @@ class TAgentTotalModel extends Model
->
join
(
"a_agents b"
,
"a.agent_id = b.id"
,
"left"
)
->
where
(
$where_
)
->
select
();
// dump($this->getLastSql());
return
$return
;
}
}
\ 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