代码兼容性提交
This commit is contained in:
@@ -113,10 +113,10 @@ class PosterWeChatMiniProgram extends Controller
|
||||
if ($result['errcode'] == 0 && isset($result['phone_info']['phoneNumber'])) {
|
||||
|
||||
// TODO 拿到手机号之后的后续操作:
|
||||
// 1. 先写入 ck_traffic_pool 表 identifier mobile 都是 用 phone字段的值
|
||||
$trafficPool = Db::name('traffic_pool')->where('identifier', $result['phone_info']['phoneNumber'])->find();
|
||||
// 1. 先写入 ck_traffic_pool_v1 表 identifier mobile 都是 用 phone字段的值
|
||||
$trafficPool = Db::name('traffic_pool_v1')->where('identifier', $result['phone_info']['phoneNumber'])->find();
|
||||
if (!$trafficPool) {
|
||||
Db::name('traffic_pool')->insert([
|
||||
Db::name('traffic_pool_v1')->insert([
|
||||
'identifier' => $result['phone_info']['phoneNumber'],
|
||||
'mobile' => $result['phone_info']['phoneNumber'],
|
||||
'createTime' => time()
|
||||
@@ -259,7 +259,7 @@ class PosterWeChatMiniProgram extends Controller
|
||||
continue;
|
||||
}
|
||||
$isPhone = preg_match('/^\+?\d{6,}$/', $identifier);
|
||||
$trafficPool = Db::name('traffic_pool')->where('identifier', $identifier)->find();
|
||||
$trafficPool = Db::name('traffic_pool_v1')->where('identifier', $identifier)->find();
|
||||
if (!$trafficPool) {
|
||||
$insertData = [
|
||||
'identifier' => $identifier,
|
||||
@@ -270,7 +270,7 @@ class PosterWeChatMiniProgram extends Controller
|
||||
} else {
|
||||
$insertData['wechatId'] = $identifier;
|
||||
}
|
||||
Db::name('traffic_pool')->insert($insertData);
|
||||
Db::name('traffic_pool_v1')->insert($insertData);
|
||||
} else {
|
||||
$updates = [];
|
||||
if ($isPhone && empty($trafficPool['mobile'])) {
|
||||
@@ -281,7 +281,7 @@ class PosterWeChatMiniProgram extends Controller
|
||||
}
|
||||
if (!empty($updates)) {
|
||||
$updates['updateTime'] = time();
|
||||
Db::name('traffic_pool')->where('id', $trafficPool['id'])->update($updates);
|
||||
Db::name('traffic_pool_v1')->where('id', $trafficPool['id'])->update($updates);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user