作者 lyh

gx

... ... @@ -109,7 +109,7 @@ class CustomTemplateLogic extends BaseLogic
//生成一条删除路由记录
$data = [
'source'=>RouteMap::SOURCE_PAGE,
'route'=>$route,
'route'=>$info['url'],
];
$this->setRouteDeleteSave($data);
}
... ... @@ -124,14 +124,37 @@ class CustomTemplateLogic extends BaseLogic
* @time :2023/6/29 16:21
*/
public function customTemplateDel(){
$rs = $this->model->edit(['deleted_status'=>1,'deleted_at'=>date('Y-m-d H:i:s')],['id'=>$this->param['id']]);
if($rs === false){
$this->fail('error');
try {
$this->delRoute($this->param['id']);
$this->model->del(['id'=>$this->param['id']]);
}catch (\Exception $e){
$this->fail('系统错误,请联系管理员');
}
return $this->success();
}
/**
* @remark :删除路由
* @name :delRoute
* @author :lyh
* @method :post
* @time :2023/9/7 10:50
*/
public function delRoute($id)
{
//删除路由映射
RouteMap::delRoute(RouteMap::SOURCE_PAGE, $id, $this->user['project_id']);
//生成一条删除路由记录
$info = $this->model->read(['id' => $id], ['id', 'url']);
$data = [
'source' => RouteMap::SOURCE_NEWS,
'route' => $info['url'],
];
$this->setRouteDeleteSave($data);
return $this->success();
}
/**
* @remark :获取body的详情
* @name :getBodyHeaderFooter
* @author :lyh
... ...