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
9e152386
Commit
9e152386
authored
Mar 06, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通话话费计算
parent
342da585
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
6 deletions
+15
-6
Client.php
application/api_broker/controller/Client.php
+1
-1
CellPhone.php
application/index/controller/CellPhone.php
+1
-1
AliYunPhone.php
application/model/AliYunPhone.php
+4
-2
SecretReport.php
application/model/SecretReport.php
+9
-2
No files found.
application/api_broker/controller/Client.php
View file @
9e152386
...
...
@@ -46,7 +46,7 @@ class Client extends Basic
$data
=
array
();
if
(
$this
->
params
[
'user_nick'
]
||
$this
->
params
[
'user_nick'
]
||
$this
->
params
[
'id'
])
{
if
(
$this
->
request
->
isPost
())
{
if
(
$this
->
params
[
'id'
]
)
{
if
(
!
empty
(
$this
->
params
[
'id'
])
)
{
//编辑
$data
[
'start'
]
=
$this
->
user
->
edit
(
$this
->
params
,
$this
->
params
[
'id'
]);
...
...
application/index/controller/CellPhone.php
View file @
9e152386
...
...
@@ -168,7 +168,7 @@ class CellPhone extends Basic
$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,time,voice_file'
;
$field
=
'agents_id,users_id,call_type,call_time,time,voice_file'
;
$where
=
[];
if
(
$this
->
params
[
'start_time'
])
{
...
...
application/model/AliYunPhone.php
View file @
9e152386
...
...
@@ -32,9 +32,11 @@ class AliYunPhone extends BaseModel
$phone_x
=
Db
::
table
(
'aliYun_binding_phone'
)
->
alias
(
'a'
)
->
join
(
'aliYun_phone b'
,
'a.aliYun_phone_id = b.id'
,
'left'
)
->
where
([
'phone_b'
=>
$phone
,
'a.status'
=>
1
'phone_b'
=>
$phone
,
'a.status'
=>
0
,
'b.status'
=>
0
])
->
value
(
'phone_x'
);
if
(
$phone_x
)
{
$where
[
'phone_x'
]
=
$phone_x
;
}
...
...
application/model/SecretReport.php
View file @
9e152386
...
...
@@ -76,7 +76,7 @@ class SecretReport extends Model
$result
[
$k
][
'time'
]
=
$v
->
time
;
//主叫收费
if
(
$v
->
call_type
==
0
)
{
if
(
strtotime
(
$v
->
release_time
)
-
strtotime
(
$v
->
start_time
)
>
0
)
{
if
(
$v
->
time
>
0
)
{
if
(
$v
->
time
<=
60
)
{
$time
=
1
;
//不足一分钟按一分钟
}
else
{
...
...
@@ -91,6 +91,8 @@ class SecretReport extends Model
}
else
{
$result
[
$k
][
'price'
]
=
0
;
}
}
else
{
$result
[
$k
][
'price'
]
=
0
;
}
}
...
...
@@ -154,9 +156,11 @@ class SecretReport extends Model
}
$result
[
$k
][
'time'
]
=
$v
->
time
;
//主叫收费
if
(
$v
->
call_type
==
0
)
{
if
(
strtotime
(
$v
->
release_time
)
-
strtotime
(
$v
->
start_time
)
>
0
)
{
if
(
$v
->
time
>
0
)
{
if
(
$v
->
time
<=
60
)
{
$time
=
1
;
//不足一分钟按一分钟
}
else
{
...
...
@@ -168,10 +172,13 @@ class SecretReport extends Model
$time
+=
floor
(
$v
->
time
/
60
);
}
$result
[
$k
][
'price'
]
=
$time
*
0.06
+
$time
*
0.05
;
//通话 0.06元/分,录音 0.05元/分
}
else
{
$result
[
$k
][
'price'
]
=
0
;
}
}
else
{
$result
[
$k
][
'price'
]
=
0
;
}
}
...
...
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