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
c3488898
Commit
c3488898
authored
Oct 31, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户来电数-修改
parent
4128a9ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
49 deletions
+49
-49
OperationData.php
application/index/controller/OperationData.php
+49
-49
No files found.
application/index/controller/OperationData.php
View file @
c3488898
...
...
@@ -100,60 +100,60 @@ class OperationData extends Basic
* 客户来电数
* @return \think\Response
*/
//
public function userPhoneNum()
//
{
//
$params = $this->params;
//
if (!$params['create_time_start'] && !$params['create_time_end']) {
//
$params['create_time_start'] = date("Y-m-1", time());
//
$params['create_time_end'] = date("Y-m-d", time());
//
}
//
$params_['a.create_time'] = [ 'between', [ $params['create_time_start'] . ' 00:00:00', $params['create_time_end'] . ' 23:59:59' ] ];
//
// 先查新所有部门
//
$district_list = $this->getDistrict();
//
//
foreach ($district_list as $key => $v) {
//
$result_["id"] = $v['id'];
//
$result_["district_name"] = $v['district_name'];
//
//
// 客户来电数
//
$params_["b.district_id"] = $v['id'];
//
$model = new AUserCallAgent();
//
$res = $model->getUserCallAgentCount($params_);
//
dump($res);
//
$result_["call_number_total"] = isset($res) ? $res : 0;
//
$result[] = $result_;
//
}
//
return $this->response(200, 'success', $result);
//
}
public
function
userPhoneNum
()
{
$params
=
$this
->
params
;
if
(
!
$params
[
'create_time_start'
]
&&
!
$params
[
'create_time_end'
])
{
$params
[
'create_time_start'
]
=
date
(
"Y-m-1"
,
time
());
$params
[
'create_time_end'
]
=
date
(
"Y-m-d"
,
time
());
}
$params_
[
'a.create_time'
]
=
[
'between'
,
[
$params
[
'create_time_start'
]
.
' 00:00:00'
,
$params
[
'create_time_end'
]
.
' 23:59:59'
]
];
// 先查新所有部门
$district_list
=
$this
->
getDistrict
();
foreach
(
$district_list
as
$key
=>
$v
)
{
$result_
[
"id"
]
=
$v
[
'id'
];
$result_
[
"district_name"
]
=
$v
[
'district_name'
];
// 客户来电数
$params_
[
"b.district_id"
]
=
$v
[
'id'
];
$model
=
new
AUserCallAgent
();
$res
=
$model
->
getUserCallAgentCount
(
$params_
);
dump
(
$res
);
$result_
[
"call_number_total"
]
=
isset
(
$res
)
?
$res
:
0
;
$result
[]
=
$result_
;
}
return
$this
->
response
(
200
,
'success'
,
$result
);
}
/**
* 客户来电数
* @return \think\Response
*/
public
function
userPhoneNum
()
{
$params
=
$this
->
params
;
$params_
[
'a.create_time'
]
=
[
'between'
,
[
$params
[
'create_time_start'
]
.
' 00:00:00'
,
$params
[
'create_time_end'
]
.
' 23:59:59'
]
];
// 先查新所有部门
$district_list
=
$this
->
getDistrict
();
foreach
(
$district_list
as
$key
=>
$v
)
{
$result_
[
"id"
]
=
$v
[
'id'
];
$result_
[
"district_name"
]
=
$v
[
'district_name'
];
// 客户来电数
$params
=
[];
$params
[
"district_id"
]
=
$v
[
'id'
];
//$params["status"] = 0; //只查询正常状态的经纪人
$field
=
"sum(call_number) as call_number_total"
;
$agentModel
=
new
AAgents
();
$res
=
$agentModel
->
getUserPhoneNum
(
$field
,
$params
);
$result_
[
"call_number_total"
]
=
isset
(
$res
[
0
][
'call_number_total'
])
?
$res
[
0
][
'call_number_total'
]
:
0
;
$result
[]
=
$result_
;
}
return
$this
->
response
(
200
,
'success'
,
$result
);
}
//
public function userPhoneNum()
//
{
//
$params = $this->params;
//
$params_['a.create_time'] = [ 'between', [ $params['create_time_start'] . ' 00:00:00', $params['create_time_end'] . ' 23:59:59' ] ];
//
// 先查新所有部门
//
$district_list = $this->getDistrict();
//
//
foreach ($district_list as $key => $v) {
//
$result_["id"] = $v['id'];
//
$result_["district_name"] = $v['district_name'];
//
//
// 客户来电数
//
$params = [];
//
$params["district_id"] = $v['id'];
//
//$params["status"] = 0; //只查询正常状态的经纪人
//
$field = "sum(call_number) as call_number_total";
//
$agentModel = new AAgents();
//
$res = $agentModel->getUserPhoneNum($field, $params);
//
//
$result_["call_number_total"] = isset($res[0]['call_number_total']) ? $res[0]['call_number_total'] : 0;
//
$result[] = $result_;
//
}
//
return $this->response(200, 'success', $result);
//
}
/**
* 新增-注册-登录用户数
...
...
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