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
1140f218
Commit
1140f218
authored
Mar 02, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拨打界面新增号码限制
parent
4f4cbc0a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
16 deletions
+27
-16
CellPhone.php
application/api_broker/controller/CellPhone.php
+3
-0
Basic.php
application/api_broker/extend/Basic.php
+1
-0
AAgentsPhone.php
application/model/AAgentsPhone.php
+23
-16
No files found.
application/api_broker/controller/CellPhone.php
View file @
1140f218
...
@@ -31,6 +31,7 @@ class CellPhone extends Basic
...
@@ -31,6 +31,7 @@ class CellPhone extends Basic
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
public
function
bindAXB
()
{
public
function
bindAXB
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
request
->
param
();
$params
=
$this
->
request
->
param
();
if
(
$params
[
'phone_a'
]
||
$params
[
'phone_b'
])
{
if
(
$params
[
'phone_a'
]
||
$params
[
'phone_b'
])
{
$phone_a
=
$this
->
params
[
'phone_a'
];
//经纪人手机号
$phone_a
=
$this
->
params
[
'phone_a'
];
//经纪人手机号
...
@@ -88,6 +89,7 @@ class CellPhone extends Basic
...
@@ -88,6 +89,7 @@ class CellPhone extends Basic
* @return \think\Response
* @return \think\Response
*/
*/
public
function
updateBindAXB
()
{
public
function
updateBindAXB
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
request
->
param
();
$params
=
$this
->
request
->
param
();
if
(
$params
[
'phone_x'
]
&&
(
$params
[
'phone_a'
]
||
$params
[
'phone_b'
]))
{
if
(
$params
[
'phone_x'
]
&&
(
$params
[
'phone_a'
]
||
$params
[
'phone_b'
]))
{
$bind
=
new
BindingPhone
();
$bind
=
new
BindingPhone
();
...
@@ -121,6 +123,7 @@ class CellPhone extends Basic
...
@@ -121,6 +123,7 @@ class CellPhone extends Basic
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
public
function
agentsUnBind
()
{
public
function
agentsUnBind
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$phone_x
=
$this
->
params
[
'phone_x'
];
$phone_x
=
$this
->
params
[
'phone_x'
];
$phone_a
=
$this
->
params
[
'phone_a'
];
$phone_a
=
$this
->
params
[
'phone_a'
];
$phone_b
=
$this
->
params
[
'phone_b'
];
$phone_b
=
$this
->
params
[
'phone_b'
];
...
...
application/api_broker/extend/Basic.php
View file @
1140f218
...
@@ -12,6 +12,7 @@ namespace app\api_broker\extend;
...
@@ -12,6 +12,7 @@ namespace app\api_broker\extend;
use
app\model\AAgents
;
use
app\model\AAgents
;
use
app\model\Users
;
use
app\model\Users
;
use
app\model\GOperatingRecords
;
use
app\model\GOperatingRecords
;
use
Firebase\JWT\JWT
;
use
think\Controller
;
use
think\Controller
;
use
think\Db
;
use
think\Db
;
use
think\Request
;
use
think\Request
;
...
...
application/model/AAgentsPhone.php
View file @
1140f218
...
@@ -20,27 +20,34 @@ class AAgentsPhone extends BaseModel
...
@@ -20,27 +20,34 @@ class AAgentsPhone extends BaseModel
* @throws \Exception
* @throws \Exception
*/
*/
public
function
add
(
$id
,
$phone
)
{
public
function
add
(
$id
,
$phone
)
{
if
(
is_array
(
$phone
))
{
$num
=
$this
->
where
([
'agents_id'
=>
$id
,
'status'
=>
0
])
->
count
();
$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'
]
=
$v
;
}
}
$result
=
$this
->
saveAll
(
$insert_data
);
$phone_num
=
count
(
$phone
);
if
((
$num
>
2
)
||
(
$phone_num
>
2
))
{
$result
=
0
;
}
else
{
}
else
{
$is
=
$this
->
get
([
'phone'
=>
$phone
,
'agents_id'
=>
$id
,
'status'
=>
0
]);
//去重
if
(
is_array
(
$phone
))
{
if
(
!
$is
){
$insert_data
=
[];
$result
=
$this
->
save
([
'phone'
=>
$phone
,
'agents_id'
=>
$id
]);
$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'
]
=
$v
;
}
}
$result
=
$this
->
saveAll
(
$insert_data
);
}
else
{
}
else
{
$result
=
0
;
$is
=
$this
->
get
([
'phone'
=>
$phone
,
'agents_id'
=>
$id
,
'status'
=>
0
]);
//去重
if
(
!
$is
){
$result
=
$this
->
save
([
'phone'
=>
$phone
,
'agents_id'
=>
$id
]);
}
else
{
$result
=
0
;
}
}
}
}
}
return
$result
;
return
$result
;
}
}
...
...
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