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
cb5d571d
Commit
cb5d571d
authored
Sep 04, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
冻结解绑号码
parent
e3ec27b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
1 deletion
+43
-1
Agent.php
application/index/controller/Agent.php
+17
-1
AAgents.php
application/model/AAgents.php
+26
-0
No files found.
application/index/controller/Agent.php
View file @
cb5d571d
...
@@ -21,11 +21,13 @@
...
@@ -21,11 +21,13 @@
namespace
app\index\controller
;
namespace
app\index\controller
;
use
app\api_broker\service\CallPhoneService
;
use
app\index\extend\Basic
;
use
app\index\extend\Basic
;
use
app\model\AAgents
;
use
app\model\AAgents
;
use
app\model\ABindingDevice
;
use
app\model\ABindingDevice
;
use
app\model\Agents
;
use
app\model\Agents
;
use
app\model\AStore
;
use
app\model\AStore
;
use
app\model\BindingPhone
;
use
app\model\Evaluate
;
use
app\model\Evaluate
;
use
app\model\Regions
;
use
app\model\Regions
;
use
think\Exception
;
use
think\Exception
;
...
@@ -257,7 +259,7 @@ class Agent extends Basic
...
@@ -257,7 +259,7 @@ class Agent extends Basic
public
function
updateStatus
()
public
function
updateStatus
()
{
{
$data
=
$this
->
request
->
param
();
$data
=
$this
->
request
->
param
();
$ids
=
$data
[
'ids'
]
;
$ids
=
5740
;
//排除超级管理员
//排除超级管理员
if
(
is_array
(
$ids
))
{
if
(
is_array
(
$ids
))
{
if
(
in_array
(
1
,
$ids
))
{
if
(
in_array
(
1
,
$ids
))
{
...
@@ -281,6 +283,20 @@ class Agent extends Basic
...
@@ -281,6 +283,20 @@ class Agent extends Basic
//同时修改设备绑定表
//同时修改设备绑定表
$m_agent_device
=
new
ABindingDevice
();
$m_agent_device
=
new
ABindingDevice
();
$m_agent_device
->
updateDate
([
'is_forbidden'
=>
$is_forbidden
],
[
'agent_id'
=>
$ids
]);
$m_agent_device
->
updateDate
([
'is_forbidden'
=>
$is_forbidden
],
[
'agent_id'
=>
$ids
]);
if
(
$data
[
'status'
]
==
1
)
{
$where
[
'a.id'
]
=
$ids
;
$where
[
'b.status'
]
=
1
;
$agent_phone
=
$m_agent
->
getAgentCallPhone
(
'b.phone_a,b.phone_b,c.phone_x'
,
$where
);
if
(
!
empty
(
$agent_phone
[
'data'
])
&&
$agent_phone
[
'status'
]
!=
'fail'
)
{
$call
=
new
CallPhoneService
();
foreach
(
$agent_phone
as
$k
=>
$v
)
{
$call
->
agentsUnBind
(
$v
[
'phone_a'
],
$v
[
'phone_b'
],
$v
[
'phone_x'
],
0
);
}
}
}
return
$this
->
response
(
200
,
'成功'
,
$data
);
return
$this
->
response
(
200
,
'成功'
,
$data
);
}
else
{
}
else
{
return
$this
->
response
(
100
,
'失败'
,
$data
);
return
$this
->
response
(
100
,
'失败'
,
$data
);
...
...
application/model/AAgents.php
View file @
cb5d571d
...
@@ -1123,4 +1123,29 @@ class AAgents extends BaseModel
...
@@ -1123,4 +1123,29 @@ class AAgents extends BaseModel
}
}
return
$data
;
return
$data
;
}
}
/**
* 获取绑定号码
*
* @param $field
* @param $where
* @return mixed
*/
public
function
getAgentCallPhone
(
$field
,
$where
)
{
try
{
$result
[
'data'
]
=
$this
->
alias
(
'a'
)
->
field
(
$field
)
->
join
(
'aliYun_binding_phone b'
,
'a.phone = b.phone_a'
,
'left'
)
->
join
(
'aliYun_phone c'
,
'b.aliYun_phone_id = c.id'
,
'left'
)
->
where
(
$where
)
->
select
();
$result
[
'status'
]
=
'successful'
;
}
catch
(
\Exception
$e
)
{
$result
[
'data'
]
=
[];
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
$e
->
getMessage
();
}
return
$result
;
}
}
}
\ 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