作者 lyh

gx

... ... @@ -544,21 +544,15 @@ class ProjectUpdate extends Command
$url = $api_url . '?' . http_build_query(['w' => $api_type, 'page' => 1, 'pagesize' => 0]);
$data = curl_c($url);
if (isset($data['code']) && $data['code'] == 200) {
$category = $data['data']['category'] ?? [];
if (empty($category)) {
$route_model = new RouteMap();
$route_page = $route_model->read(['source' => 'page', 'route' => $custom_info['route']], 'id');
if (!$route_page) {
$category = [
[
'id' => 0,
'name' => $custom_info['route'],
'url' => '/' . $custom_info['route'],
'parent' => 0
]
];
}
}
$category = [
[
'id' => 0,
'name' => $custom_info['route'],
'url' => '/' . $custom_info['route'],
'parent' => 0,
'children' => $data['data']['category'] ?? []
]
];
$this->category_custom_insert($project_id, $custom_info['id'], $category, 0);
$count = $data['data']['count'] ?? 0;
... ...
... ... @@ -95,7 +95,7 @@ class UpdateProductCategory extends Command
foreach ($cate_arr as $v){
$categoryModel = new Category();
$info = $categoryModel->read(['id'=>$v],['id']);
if($info !== false){
if($info === false){
continue;
}else{
//更新关联表
... ...
... ... @@ -176,9 +176,8 @@ class BlogController extends BaseController
}
/**
* @name :获取当前博客详情
* @author :liyuhang
* @method
* 获取当前博客详情
* @param BlogLogic $blogLogic
*/
public function info(BlogLogic $blogLogic){
$this->request->validate([
... ... @@ -187,15 +186,17 @@ class BlogController extends BaseController
'id.required' => 'ID不能为空'
]);
$info = $blogLogic->blogInfo();
$template_id = $this->getTemplateId(BTemplate::SOURCE_BLOG,BTemplate::IS_DETAIL);
$info['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_BLOG,BTemplate::IS_DETAIL,$template_id, $info['id']);
$this->response('success',Code::SUCCESS,$info);
}
/**
* @remark :保存数据
* @name :save
* @author :lyh
* @method :post
* @time :2023/9/7 13:40
* 保存数据
* @param BlogRequest $request
* @param BlogLogic $blogLogic
*/
public function save(BlogRequest $request,BlogLogic $blogLogic){
$request->validated();
... ...
... ... @@ -154,18 +154,19 @@ class NewsController extends BaseController
/**
* @name :添加新闻时获取分类列表
* @author :liyuhang
* @method
* 添加新闻时获取分类列表
* @param NewsLogic $newsLogic
* @throws \App\Exceptions\BsideGlobalException
*/
public function get_category_list(NewsLogic $newsLogic){
$list = $newsLogic->news_get_category_list();
$this->response('success',Code::SUCCESS,$list);
}
/**
* @name :获取详情
* @author :liyuhang
* @method
* 获取新闻详情
* @param NewsLogic $newsLogic
* @throws \App\Exceptions\BsideGlobalException
*/
public function info(NewsLogic $newsLogic){
$this->request->validate([
... ... @@ -174,6 +175,10 @@ class NewsController extends BaseController
'id.required' => 'ID不能为空',
]);
$info = $newsLogic->newsInfo();
$template_id = $this->getTemplateId(BTemplate::SOURCE_NEWS,BTemplate::IS_DETAIL);//获取模版id
$info['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_NEWS,BTemplate::IS_DETAIL,$template_id, $info['id']);
$this->response('success',Code::SUCCESS,$info);
}
... ...