1、新增一个所有好友的流量池
2、旧版场景获客数据迁移 3、场景获客功能兼容旧版数据
This commit is contained in:
@@ -347,10 +347,31 @@ class PosterWeChatMiniProgram extends Controller
|
||||
function getPosterTaskData()
|
||||
{
|
||||
$id = request()->param('id');
|
||||
$task = Db::name('customer_acquisition_task')
|
||||
->where(['id' => $id, 'deleteTime' => 0])
|
||||
->field('id,name,sceneConf,status')
|
||||
->find();
|
||||
$oldId = request()->param('oldId');
|
||||
|
||||
// 兼容旧数据:如果传了 oldId,通过 legacyId 和 isLegacy 查找
|
||||
if (!empty($oldId)) {
|
||||
$task = Db::name('customer_acquisition_task')
|
||||
->where([
|
||||
'legacyId' => $oldId,
|
||||
'isLegacy' => 1,
|
||||
'deleteTime' => 0
|
||||
])
|
||||
->field('id,name,sceneConf,status')
|
||||
->find();
|
||||
} elseif (!empty($id)) {
|
||||
// 新数据:直接用 id 查找
|
||||
$task = Db::name('customer_acquisition_task')
|
||||
->where(['id' => $id, 'deleteTime' => 0])
|
||||
->field('id,name,sceneConf,status')
|
||||
->find();
|
||||
} else {
|
||||
return json([
|
||||
'code' => 400,
|
||||
'message' => '任务ID不能为空'
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$task) {
|
||||
return json([
|
||||
'code' => 400,
|
||||
@@ -367,8 +388,8 @@ class PosterWeChatMiniProgram extends Controller
|
||||
|
||||
$sceneConf = json_decode($task['sceneConf'], true);
|
||||
|
||||
if (isset($sceneConf['posters']['url'])) {
|
||||
$posterUrl = !empty($sceneConf['posters']['url']);
|
||||
if (isset($sceneConf['posters']['url']) && !empty($sceneConf['posters']['url'])) {
|
||||
$posterUrl = $sceneConf['posters']['url'];
|
||||
} else {
|
||||
$posterUrl = 'https://hebbkx1anhila5yf.public.blob.vercel-storage.com/%E7%82%B9%E5%87%BB%E5%92%A8%E8%AF%A2-FTiyAMAPop2g9LvjLOLDz0VwPg3KVu.gif';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user