新版流量池提交
This commit is contained in:
@@ -76,13 +76,20 @@ class WechatFriendController extends BaseController
|
||||
$result = requestCurl($this->baseUrl . 'api/WechatFriend/friendlistData', $params, 'POST', $header, 'json');
|
||||
$response = handleApiResponse($result);
|
||||
|
||||
// 确保 response 是数组格式
|
||||
if (!is_array($response)) {
|
||||
$response = [];
|
||||
}
|
||||
|
||||
// 保存数据到数据库
|
||||
if (is_array($response)) {
|
||||
if (!empty($response)) {
|
||||
$isUpdate = false;
|
||||
foreach ($response as $item) {
|
||||
$updated = $this->saveFriend($item);
|
||||
if($updated && $isDel == 0){
|
||||
$isUpdate = true;
|
||||
if (is_array($item)) {
|
||||
$updated = $this->saveFriend($item);
|
||||
if($updated && $isDel == 0){
|
||||
$isUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user