|
@@ -1446,9 +1446,21 @@ class WebsiteService implements WebsiteServiceInterface
|
|
|
}
|
|
|
// return Result::success($result);
|
|
|
$result['template_img'] = $template_img;
|
|
|
- if (empty($result)) {
|
|
|
- return Result::error("没有查找到相关数据", 0);
|
|
|
- } else {
|
|
|
+ $result['page_type'] = $page_type;
|
|
|
+ // 查找 $template 在 $templates 数组中的索引
|
|
|
+ // $index = array_search($template['template_id'], array_column($data['templates'], 'id'));
|
|
|
+
|
|
|
+ // 如果找到了 $template,则计算它所在的页码
|
|
|
+ // if ($index !== false) {
|
|
|
+ // $page = floor($index / $data['pageSize']) + 1;
|
|
|
+ // $result['page'] = $page;
|
|
|
+ // echo "查询到的 template 在第 $page 页";
|
|
|
+ // } else {
|
|
|
+ // echo "未找到查询到的 template";
|
|
|
+ // }
|
|
|
+ if(empty($result)){
|
|
|
+ return Result::error("没有查找到相关数据",0);
|
|
|
+ }else{
|
|
|
return Result::success($result);
|
|
|
}
|
|
|
}
|