海报代码提交
This commit is contained in:
@@ -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
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user