海报代码提交

This commit is contained in:
wong
2025-07-10 14:57:32 +08:00
parent 0bbb9c1273
commit 6392b99e13
2 changed files with 38 additions and 4 deletions

View File

@@ -124,12 +124,45 @@ class PosterWeChatMiniProgram extends Controller
// todo 获取海报获客任务的任务/海报数据 -- 表还没设计好,不急 ck_customer_acquisition_task
public function getPosterTaskData() {
$id = request()->param('id');
$task = Db::name('customer_acquisition_task')->where('id', $id)->find();
$task = Db::name('customer_acquisition_task')->where(['id' => $id,'deleteTime' => 0])->find();
if (!$task) {
return json([
'code' => 400,
'message' => '任务不存在'
]);
}
if($task['status'] == 0) {
return json([
'code' => 400,
'message' => '任务已结束'
]);
}
$sceneConf = json_decode($task['sceneConf'], true);
if(isset($sceneConf['posters'][0]['preview'])) {
$posterUrl = $sceneConf['posters'][0]['preview'];
} else {
$posterUrl = '';
}
$data = [
'id' => $task['id'],
'name' => $task['name'],
'poster' => ['sUrl' => $posterUrl],
'sTip' => '啦啦啦啦',
];
// todo 只需 返回 poster_url success_tip
return json([
'code' => 0,
'code' => 10000,
'message' => '获取海报获客任务数据成功',
'data' => $task
'data' => $data
]);
}