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
2da89808
Commit
2da89808
authored
Mar 02, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增拨打号码界面接口修改
parent
b7ec01f0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
CellPhone.php
application/api_broker/controller/CellPhone.php
+8
-1
AAgentsPhone.php
application/model/AAgentsPhone.php
+8
-3
No files found.
application/api_broker/controller/CellPhone.php
View file @
2da89808
...
...
@@ -155,13 +155,20 @@ class CellPhone extends Basic
* @throws \think\exception\DbException
*/
public
function
agentsPhone
()
{
header
(
'Access-Control-Allow-Origin:*'
);
if
(
$this
->
params
[
'agents_id'
])
{
$agents_phone
=
new
AAgentsPhone
();
if
(
$this
->
request
->
isGet
())
{
$this
->
data
=
$agents_phone
->
getList
(
1
,
15
,
'id asc'
,
'id,phone'
,
'status = 0'
);
$where
[
'agents_id'
]
=
$this
->
params
[
'agents_id'
];
$where
[
'status'
]
=
0
;
$this
->
data
=
$agents_phone
->
getList
(
1
,
3
,
'id asc'
,
'id,phone'
,
$where
);
}
else
{
if
(
$this
->
params
[
'type'
]
==
'delete'
)
{
$this
->
data
=
$agents_phone
->
delPhone
(
$this
->
params
[
'agents_id'
],
$this
->
params
[
'phone'
]);
}
else
{
$this
->
data
=
$agents_phone
->
add
(
$this
->
params
[
'agents_id'
],
$this
->
params
[
'phone'
]);
}
}
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'agents_id is null'
;
...
...
application/model/AAgentsPhone.php
View file @
2da89808
...
...
@@ -22,13 +22,18 @@ class AAgentsPhone extends BaseModel
public
function
add
(
$id
,
$phone
)
{
if
(
is_array
(
$phone
))
{
$insert_data
=
[];
$phone
=
array_unique
(
$phone
);
foreach
(
$phone
as
$k
=>
$v
)
{
$is
=
$this
->
get
([
'phone'
=>
$v
,
'agents_id'
=>
$id
,
'status'
=>
0
]);
//去重
if
(
empty
(
$is
->
id
))
{
$insert_data
[
$k
][
'agents_id'
]
=
$id
;
$insert_data
[
$k
][
'phone'
]
=
$phone
;
$insert_data
[
$k
][
'phone'
]
=
$v
;
}
$result
=
$this
->
saveAll
(
array_unique
(
$insert_data
));
}
$result
=
$this
->
saveAll
(
$insert_data
);
}
else
{
$is
=
$this
->
get
([
'phone'
=>
$phone
,
'agents_id'
=>
$id
]);
$is
=
$this
->
get
([
'phone'
=>
$phone
,
'agents_id'
=>
$id
,
'status'
=>
0
]);
//去重
if
(
!
$is
){
$result
=
$this
->
save
([
'phone'
=>
$phone
,
'agents_id'
=>
$id
]);
}
else
{
...
...
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