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
29cc85d6
Commit
29cc85d6
authored
Nov 08, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量插入
parent
6eeb6be9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
13 deletions
+29
-13
BindingPhone.php
application/model/BindingPhone.php
+10
-0
PrivacyNumber.php
application/task/controller/PrivacyNumber.php
+19
-13
No files found.
application/model/BindingPhone.php
View file @
29cc85d6
...
@@ -250,4 +250,13 @@ class BindingPhone extends BaseModel
...
@@ -250,4 +250,13 @@ class BindingPhone extends BaseModel
->
where
(
'create_time'
,
'between'
,
[
$date
.
' 00:00:00'
,
$date
.
' 23:59:59'
])
->
where
(
'create_time'
,
'between'
,
[
$date
.
' 00:00:00'
,
$date
.
' 23:59:59'
])
->
count
();
->
count
();
}
}
/**
* @param $data
* @return array|false
* @throws \Exception
*/
public
function
updateAll
(
$data
)
{
return
$this
->
saveAll
(
$data
);
}
}
}
\ No newline at end of file
application/task/controller/PrivacyNumber.php
View file @
29cc85d6
...
@@ -137,9 +137,7 @@ class PrivacyNumber
...
@@ -137,9 +137,7 @@ class PrivacyNumber
/**
/**
* 释放过期的绑定关系
* 释放过期的绑定关系
*
*
* @throws \think\db\exception\DataNotFoundException
* @throws \Exception
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
*/
public
function
releaseNumber
()
public
function
releaseNumber
()
{
{
...
@@ -176,8 +174,10 @@ class PrivacyNumber
...
@@ -176,8 +174,10 @@ class PrivacyNumber
//释放阿里云隐私号码
//释放阿里云隐私号码
$result
=
PlsDemo
::
unbindSubscription
(
$v
[
'subsId'
],
$v
[
'phone_x'
]);
$result
=
PlsDemo
::
unbindSubscription
(
$v
[
'subsId'
],
$v
[
'phone_x'
]);
if
(
$result
->
Message
==
'OK'
)
{
if
(
$result
->
Message
==
'OK'
)
{
// $bind->unBind($v['phone_x'], $v['phone_a'], $v['phone_b'], $result->RequestId);
$update
[]
=
[
$bind
->
unBindTable
(
$v
[
'id'
]);
'id'
=>
$v
[
'id'
],
'status'
=>
0
];
$binding_phone_id
[
$k
]
=
$v
[
'id'
];
$binding_phone_id
[
$k
]
=
$v
[
'id'
];
$phone_id
[
$k
]
=
$v
[
'aliYun_phone_id'
];
$phone_id
[
$k
]
=
$v
[
'aliYun_phone_id'
];
}
}
...
@@ -189,15 +189,20 @@ class PrivacyNumber
...
@@ -189,15 +189,20 @@ class PrivacyNumber
$tong_xun
=
new
RongDemo
();
$tong_xun
=
new
RongDemo
();
$result
=
$tong_xun
->
releaseNumber
(
$v
[
'mappingId'
]);
/*解绑*/
$result
=
$tong_xun
->
releaseNumber
(
$v
[
'mappingId'
]);
/*解绑*/
if
(
$result
[
'statusCode'
]
==
'000000'
)
{
if
(
$result
[
'statusCode'
]
==
'000000'
)
{
// $bind->unBind($v['phone_x'], $v['phone_a'], $v['phone_b']);
$bind
->
unBindTable
(
$v
[
'id'
]);
$binding_phone_id
[
$k
]
=
$v
[
'id'
];
$binding_phone_id
[
$k
]
=
$v
[
'id'
];
$phone_id
[
$k
]
=
$v
[
'aliYun_phone_id'
];
$phone_id
[
$k
]
=
$v
[
'aliYun_phone_id'
];
$update
[]
=
[
'id'
=>
$v
[
'id'
],
'status'
=>
0
];
}
else
{
}
else
{
$yun_result
=
$tong_xun
->
getBindInfo
(
$v
[
'phone_a'
],
$v
[
'phone_b'
],
$v
[
'phone_x'
],
$v
[
'mappingId'
]);
$yun_result
=
$tong_xun
->
getBindInfo
(
$v
[
'phone_a'
],
$v
[
'phone_b'
],
$v
[
'phone_x'
],
$v
[
'mappingId'
]);
if
(
empty
(
$yun_result
[
'data'
][
'mappingId'
]))
{
if
(
empty
(
$yun_result
[
'data'
][
'mappingId'
]))
{
// $bind->unBind($v['phone_x'], $v['phone_a'], $v['phone_b']);
$update
[]
=
[
$bind
->
unBindTable
(
$v
[
'id'
]);
'id'
=>
$v
[
'id'
],
'status'
=>
0
];
}
}
}
}
...
@@ -206,6 +211,11 @@ class PrivacyNumber
...
@@ -206,6 +211,11 @@ class PrivacyNumber
}
}
}
}
if
(
!
empty
(
$update
))
{
$bind
->
updateAll
(
$update
);
unset
(
$update
);
}
$id
[
'aliYun_binding_phone'
]
=
implode
(
','
,
$binding_phone_id
);
$id
[
'aliYun_binding_phone'
]
=
implode
(
','
,
$binding_phone_id
);
$id
[
'aliYun_phone'
]
=
implode
(
','
,
array_unique
(
$phone_id
));
$id
[
'aliYun_phone'
]
=
implode
(
','
,
array_unique
(
$phone_id
));
Log
::
write
(
json_encode
(
$id
),
'AliYunReleaseNumber'
);
//记录日志
Log
::
write
(
json_encode
(
$id
),
'AliYunReleaseNumber'
);
//记录日志
...
@@ -305,10 +315,6 @@ class PrivacyNumber
...
@@ -305,10 +315,6 @@ class PrivacyNumber
/**
/**
* 去除过期绑定关系
* 去除过期绑定关系
*
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
*/
public
function
checkBindPhone
()
public
function
checkBindPhone
()
{
{
...
...
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