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
b1b52367
Commit
b1b52367
authored
Feb 27, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
隐私号码代码调整
parent
0cd91192
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
203 additions
and
87 deletions
+203
-87
CellPhone.php
application/api_broker/controller/CellPhone.php
+0
-86
CellPhone.php
application/index/controller/CellPhone.php
+198
-0
route.php
application/route.php
+5
-1
No files found.
application/api_broker/controller/CellPhone.php
View file @
b1b52367
...
...
@@ -13,7 +13,6 @@ 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
...
...
@@ -110,88 +109,4 @@ 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,time'
;
$where
=
[];
if
(
$this
->
params
[
'start_time'
])
{
$where
[
'create_time'
]
=
[
'> time'
,
$this
->
params
[
'start_time'
]];
}
if
(
$this
->
params
[
'end_time'
])
{
$where
[
'create_time'
]
=
[
'< 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
,
$pageSize
,
'id desc'
,
$field
,
$where
);
return
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$data
);
}
/**
* 经纪人通话汇总
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
callCollectList
()
{
$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
=
'a.id,b.phone,sum(time) as time,agents_id,call_type'
;
$where
=
[];
if
(
$this
->
params
[
'start_time'
])
{
$where
[
'create_time'
]
=
[
'> time'
,
$this
->
params
[
'start_time'
]];
}
if
(
$this
->
params
[
'end_time'
])
{
$where
[
'create_time'
]
=
[
'< time'
,
$this
->
params
[
'end_time'
]];
}
if
(
$this
->
params
[
'agents_name'
])
{
$where
[
'realName'
]
=
[
'LIKE'
,
$this
->
params
[
'agents_name'
]
.
'%'
];
}
if
(
$this
->
params
[
'phone'
])
{
$where
[
'phone'
]
=
[
$this
->
params
[
'phone'
]];
}
$data
=
$report
->
getCallCollect
(
$pageNo
,
$pageSize
,
'id desc'
,
$field
,
$where
);
return
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$data
);
}
}
\ No newline at end of file
application/index/controller/CellPhone.php
0 → 100644
View file @
b1b52367
<?php
/**
* Created by PhpStorm.
* User: 43897
* Date: 2018/2/12
* Time: 14:14
*/
namespace
app\index\controller
;
use
app\index\extend\Basic
;
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
{
protected
$code
=
200
;
protected
$data
=
[];
protected
$msg
=
""
;
/**
* 绑定手机号
* 解绑之后有延迟
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
bindAXB
()
{
$params
=
$this
->
request
->
param
();
if
(
$params
[
'phone_a'
]
||
$params
[
'phone_b'
])
{
$expiration
=
_EXPIRATION
;
//过期时间
$phone_a
=
$this
->
params
[
'phone_a'
];
//经纪人手机号
$phone_b
=
$this
->
params
[
'phone_b'
];
//客户手机号
$record
=
empty
(
$this
->
params
[
'record'
])
?
true
:
false
;
//是否录音
$bind
=
new
AliYunPhone
();
$phone_x
=
$bind
->
getAliYunPhone
(
$phone_b
);
//是否还有未绑定的中间号码
if
(
$phone_x
)
{
$result
=
PlsDemo
::
bindAxb
(
$phone_a
,
$phone_b
,
$expiration
,
$record
,
$phone_x
[
'phone_x'
]);
if
(
$result
->
Message
==
'OK'
)
{
$bind
->
where
(
'phone_x'
,
$phone_x
[
'phone_x'
])
->
setField
(
'status'
,
1
);
Db
::
table
(
'aliYun_binding_phone'
)
->
insert
([
'phone_a'
=>
$phone_a
,
'phone_b'
=>
$phone_b
,
'subsId'
=>
$result
->
SecretBindDTO
->
SubsId
,
'requestId'
=>
$result
->
RequestId
,
'record'
=>
$record
,
'aliYun_phone_id'
=>
$phone_x
[
'id'
]
]);
$this
->
msg
=
'Binding success.'
;
$this
->
data
=
[
'phone'
=>
$phone_x
[
'phone_x'
]];
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'Binding failure.'
;
}
}
else
{
$this
->
code
=
102
;
$this
->
msg
=
'Number pool run out.'
;
}
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'phone_a or phone_b is null'
;
}
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
}
public
function
updateBindAXB
()
{
/* $params = $this->request->param();
if ($params['phone_a'] || $params['phone_b']) {
$this->data = PlsDemo::updateSubscription($this->params['phone_a'], $this->params['phone_b'], _EXPIRATION, $params['record']);
}
return $this->response($this->code, $this->msg,$this->data);*/
}
/**
* 解除绑定关系
*
* @return \think\Response
* @throws \think\exception\DbException
*/
public
function
agentsUnBind
()
{
$phone_x
=
$this
->
params
[
'phone_x'
];
$phone_a
=
$this
->
params
[
'phone_a'
];
if
(
$phone_x
)
{
$phone
=
new
BindingPhone
();
$subsId
=
$phone
->
getSubsId
(
$phone_x
,
$phone_a
,
1
);
if
(
$subsId
)
{
$result
=
PlsDemo
::
unbindSubscription
(
$subsId
,
$phone_x
);
if
(
$result
->
Message
==
'OK'
)
{
$phone
->
UnBind
(
$phone_x
);
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'remove binding error'
;
}
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'dont\'t have about phone_x info'
;
}
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'phone_x is null'
;
}
$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,time'
;
$where
=
[];
if
(
$this
->
params
[
'start_time'
])
{
$where
[
'create_time'
]
=
[
'> time'
,
$this
->
params
[
'start_time'
]];
}
if
(
$this
->
params
[
'end_time'
])
{
$where
[
'create_time'
]
=
[
'< 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
,
$pageSize
,
'id desc'
,
$field
,
$where
);
return
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$data
);
}
/**
* 经纪人通话汇总
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
callCollectList
()
{
$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
=
'a.id,b.phone,sum(time) as time,agents_id,call_type'
;
$where
=
[];
if
(
$this
->
params
[
'start_time'
])
{
$where
[
'create_time'
]
=
[
'> time'
,
$this
->
params
[
'start_time'
]];
}
if
(
$this
->
params
[
'end_time'
])
{
$where
[
'create_time'
]
=
[
'< time'
,
$this
->
params
[
'end_time'
]];
}
if
(
$this
->
params
[
'agents_name'
])
{
$where
[
'realName'
]
=
[
'LIKE'
,
$this
->
params
[
'agents_name'
]
.
'%'
];
}
if
(
$this
->
params
[
'phone'
])
{
$where
[
'phone'
]
=
[
$this
->
params
[
'phone'
]];
}
$data
=
$report
->
getCallCollect
(
$pageNo
,
$pageSize
,
'id desc'
,
$field
,
$where
);
return
$this
->
response
(
$result
[
'code'
],
$result
[
'msg'
],
$data
);
}
}
\ No newline at end of file
application/route.php
View file @
b1b52367
...
...
@@ -143,6 +143,10 @@ Route::group('index', [
'phone_list'
=>
[
'index/Phone/index'
,[
'method'
=>
'get'
]],
//隐私号码列表
'bindPhoneList'
=>
[
'index/Phone/bindPhoneList'
,[
'method'
=>
'get'
]],
//绑定的隐私号码列表
'edit_aliYunPhone'
=>
[
'index/Phone/edit_aliYunPhone'
,[
'method'
=>
'get|post'
]],
//新增或编辑中间号
'callLog'
=>
[
'index/CellPhone/callLog'
,
[
'method'
=>
'get'
]
],
//通话记录
'callCollectList'
=>
[
'index/CellPhone/callCollectList'
,
[
'method'
=>
'get'
]
],
//经纪人通话汇总
'bindAXB'
=>
[
'index/CellPhone/bindAXB'
,
[
'method'
=>
'post'
]
],
//隐私号码
'agentsUnBind'
=>
[
'index/CellPhone/agentsUnBind'
,
[
'method'
=>
'post'
]
],
//解除绑定关系
]);
...
...
@@ -240,7 +244,7 @@ Route::group('broker', [
'callCollectList'
=>
[
'api_broker/CellPhone/callCollectList'
,
[
'method'
=>
'get'
]
],
//经纪人通话汇总
'getShopList'
=>
[
'api_broker/Shop/getShopList'
,
[
'method'
=>
'get
|post
'
]
],
'getShopList'
=>
[
'api_broker/Shop/getShopList'
,
[
'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