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
a94e3d3c
Commit
a94e3d3c
authored
Mar 01, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拨打号码用户界面接口
parent
06f1a6e0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
0 deletions
+84
-0
Broker.php
application/api_broker/controller/Broker.php
+1
-0
CellPhone.php
application/api_broker/controller/CellPhone.php
+27
-0
AAgentsPhone.php
application/model/AAgentsPhone.php
+55
-0
route.php
application/route.php
+1
-0
No files found.
application/api_broker/controller/Broker.php
View file @
a94e3d3c
...
...
@@ -364,6 +364,7 @@ class Broker extends Basic
* @throws \think\exception\DbException
*/
public
function
getAgentsByPhone
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$agents
=
new
Agents
();
$data
=
$agents
->
getInfo
(
$this
->
agentPhone
);
$data
[
'openid'
]
=
""
;
...
...
application/api_broker/controller/CellPhone.php
View file @
a94e3d3c
...
...
@@ -11,6 +11,7 @@ namespace app\api_broker\controller;
use
app\api_broker\extend\Basic
;
use
app\api_broker\untils\PlsDemo
;
use
app\model\AAgentsPhone
;
use
app\model\AliYunPhone
;
use
app\model\BindingPhone
;
use
think\Db
;
...
...
@@ -143,4 +144,29 @@ class CellPhone extends Basic
$this
->
params
[
'phone_x'
];
return
$this
->
response
(
$this
->
code
,
$this
->
msg
);
}
/**
* 获取经纪人拨打界面手机号
*
* @return \think\Response
* @throws \Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
agentsPhone
()
{
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'
);
}
else
{
$this
->
data
=
$agents_phone
->
add
(
$this
->
params
[
'agents_id'
],
$this
->
params
[
'phone'
]);
}
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'agents_id is null'
;
}
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
}
}
\ No newline at end of file
application/model/AAgentsPhone.php
0 → 100644
View file @
a94e3d3c
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/3/1
* Time: 17:56
*/
namespace
app\model
;
class
AAgentsPhone
extends
BaseModel
{
/**
* 新增用户手机
*
* @param $id
* @param $phone
* @return array|false|int
* @throws \Exception
*/
public
function
add
(
$id
,
$phone
)
{
if
(
is_array
(
$phone
))
{
$insert_data
=
[];
foreach
(
$phone
as
$k
=>
$v
)
{
$insert_data
[
$k
][
'agents_id'
]
=
$id
;
$insert_data
[
$k
][
'phone'
]
=
$phone
;
}
$result
=
$this
->
saveAll
(
array_unique
(
$insert_data
));
}
else
{
$is
=
$this
->
get
([
'phone'
=>
$phone
,
'agents_id'
=>
$id
]);
if
(
!
$is
){
$result
=
$this
->
save
([
'phone'
=>
$phone
,
'agents_id'
=>
$id
]);
}
else
{
$result
=
0
;
}
}
return
$result
;
}
/**
* 伪删除
*
* @param $id
* @param $phone
* @return mixed
*/
public
function
delPhone
(
$id
,
$phone
)
{
$result
=
$this
->
where
([
'agents_id'
=>
$id
,
'phone'
=>
$phone
])
->
setField
(
'status'
,
1
);
return
$result
;
}
}
\ No newline at end of file
application/route.php
View file @
a94e3d3c
...
...
@@ -276,6 +276,7 @@ Route::group('broker', [
'reportList'
=>
[
'api_broker/Report/reportList'
,
[
'method'
=>
'get'
]
],
'token'
=>
[
'api_broker/broker/token'
,
[
'method'
=>
'get'
]
],
'getAgentsByPhone'
=>
[
'api_broker/broker/getAgentsByPhone'
,
[
'method'
=>
'get'
]
],
'agentsPhone'
=>
[
'api_broker/CellPhone/agentsPhone'
,
[
'method'
=>
'get|post'
]
],
//获取经纪人拨打界面手机号
]);
...
...
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