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
3b9c3e71
Commit
3b9c3e71
authored
Feb 26, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通话记录
parent
611f9707
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
126 additions
and
1 deletion
+126
-1
CellPhone.php
application/api_broker/controller/CellPhone.php
+47
-0
SecretReport.php
application/model/SecretReport.php
+78
-1
route.php
application/route.php
+1
-0
No files found.
application/api_broker/controller/CellPhone.php
View file @
3b9c3e71
...
...
@@ -13,6 +13,7 @@ use app\api_broker\untils\PlsDemo;
use
app\model\AliYunPhone
;
use
app\model\BindingPhone
;
use
app\model\SecretReport
;
use
think\Db
;
class
CellPhone
extends
Basic
...
...
@@ -108,4 +109,49 @@ class CellPhone extends Basic
$this
->
params
[
'phone_x'
];
return
$this
->
response
(
$this
->
code
,
$this
->
msg
);
}
/**
* 通话列表、搜索
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
callLog
()
{
$result
[
'code'
]
=
200
;
$result
[
'msg'
]
=
''
;
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
$report
=
new
SecretReport
();
$field
=
'agents_id,users_id,release_time,start_time,call_type,call_time'
;
$where
=
[];
if
(
$this
->
params
[
'start_time'
])
{
$where
[
'call_time'
]
=
[
'>'
,
$this
->
params
[
'start_time'
]];
}
if
(
$this
->
params
[
'end_time'
])
{
$where
[
'call_time'
]
=
[
'<'
,
$this
->
params
[
'end_time'
]];
}
if
(
$this
->
params
[
'call_name'
])
{
$where
[
'realName'
]
=
[
'LIKE'
,
$this
->
params
[
'call_name'
]
.
'%'
];
}
if
(
$this
->
params
[
'call_phone'
])
{
$where
[
'phone_a'
]
=
[
$this
->
params
[
'call_phone'
]];
}
if
(
$this
->
params
[
'client_phone'
])
{
$where
[
'phone_b'
]
=
[
$this
->
params
[
'client_phone'
]];
}
if
(
$this
->
params
[
'client_name'
])
{
$where
[
'user_nick'
]
=
[
'LIKE'
,
$this
->
params
[
'client_name'
]
.
'%'
];
}
$data
=
$report
->
getCallList
(
$pageNo
,
100
,
'id asc'
,
$field
,
$where
);
return
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$data
);
}
}
\ No newline at end of file
application/model/SecretReport.php
View file @
3b9c3e71
...
...
@@ -2,11 +2,88 @@
namespace
app\model
;
use
think\Db
;
use
think\Model
;
class
SecretReport
extends
Model
{
// 设置当前模型对应的完整数据表名称
protected
$table
=
'ali
y
un_secret_report'
;
protected
$table
=
'ali
Y
un_secret_report'
;
/**
* 通话记录
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getCallList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
{
if
(
$params
[
'realName'
]
||
$params
[
'user_nick'
])
{
$field
.=
',a.id'
;
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'agents b'
,
'a.agents_id=b.id'
,
'left'
)
->
join
(
'u_users c'
,
'a.users_id=c.id'
,
'left'
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
else
{
$field
.=
',id'
;
$data
=
$this
->
field
(
$field
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
$result
=
[];
foreach
(
$data
as
$k
=>
$v
)
{
$result
[
$k
]
=
$v
;
if
(
$v
->
agents_id
)
{
$agents_data
=
Db
::
table
(
'agents'
)
->
field
(
'realName,father_id'
)
->
where
(
'id'
,
$v
->
agents_id
)
->
find
();
$result
[
$k
][
'agents_name'
]
=
$agents_data
[
'realName'
];
$shop_data
=
Db
::
table
(
'agents'
)
->
field
(
'agentshopname,sub_shopname'
)
->
where
(
'id'
,
$agents_data
[
'father_id'
])
->
find
();
$result
[
$k
][
'shop_name'
]
=
$shop_data
[
'sub_shopname'
]
?
$shop_data
[
'agentshopname'
]
.
'-'
.
$shop_data
[
'sub_shopname'
]
:
$shop_data
[
'agentshopname'
];
}
else
{
$result
[
$k
][
'agents_name'
]
=
""
;
}
if
(
$v
->
users_id
)
{
$result
[
$k
][
'user_nick'
]
=
Db
::
table
(
'u_users'
)
->
where
(
'id'
,
$v
->
users_id
)
->
value
(
'user_nick'
);
}
else
{
$result
[
$k
][
'user_nick'
]
=
""
;
}
$time_stamp
=
(
strtotime
(
$v
->
release_time
)
-
strtotime
(
$v
->
start_time
));
$result
[
'time'
]
=
$time_stamp
;
//主叫收费
if
(
$v
->
call_type
==
0
)
{
if
(
$time_stamp
<=
60
)
{
$time
=
1
;
//不足一分钟按一分钟
}
else
{
$remainder
=
$time_stamp
%
60
;
$time
=
0
;
if
(
$remainder
!=
0
)
{
$time
+=
1
;
}
$time
+=
floor
(
$time_stamp
/
60
);
}
$result
[
$k
][
'time'
]
=
$time
;
$result
[
$k
][
'price'
]
=
$time
*
0.06
+
$time
*
0.05
;
//通话 0.06元/分,录音 0.05元/分
}
}
return
$result
;
}
}
application/route.php
View file @
3b9c3e71
...
...
@@ -236,6 +236,7 @@ Route::group('broker', [
'bindAXB'
=>
[
'api_broker/CellPhone/bindAXB'
,
[
'method'
=>
'post'
]
],
//隐私号码
'agentsUnBind'
=>
[
'api_broker/CellPhone/agentsUnBind'
,
[
'method'
=>
'post'
]
],
//解除绑定关系
'callLog'
=>
[
'api_broker/CellPhone/callLog'
,
[
'method'
=>
'get'
]
],
//通话记录
]);
...
...
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