正在显示
2 个修改的文件
包含
5 行增加
和
2 行删除
| @@ -193,8 +193,11 @@ class BlogLogic extends BaseLogic | @@ -193,8 +193,11 @@ class BlogLogic extends BaseLogic | ||
| 193 | * @time :2023/10/20 9:02 | 193 | * @time :2023/10/20 9:02 |
| 194 | */ | 194 | */ |
| 195 | public function getCategory($category){ | 195 | public function getCategory($category){ |
| 196 | + if(empty($category)){ | ||
| 197 | + return ''; | ||
| 198 | + } | ||
| 196 | $str = implode(',',$category); | 199 | $str = implode(',',$category); |
| 197 | - return !empty(trim(trim($str,','),',')) ? ','.$str.',' : ''; | 200 | + return !empty(trim(trim($str,','),',')) ? ','.trim(trim($str,','),',').',' : ''; |
| 198 | } | 201 | } |
| 199 | 202 | ||
| 200 | /** | 203 | /** |
| @@ -213,7 +213,7 @@ class NewsLogic extends BaseLogic | @@ -213,7 +213,7 @@ class NewsLogic extends BaseLogic | ||
| 213 | */ | 213 | */ |
| 214 | public function getCategory($category){ | 214 | public function getCategory($category){ |
| 215 | $str = implode(',',$category); | 215 | $str = implode(',',$category); |
| 216 | - return !empty(trim(trim($str,','),',')) ? ','.$str.',' : ''; | 216 | + return !empty(trim(trim($str,','),',')) ? ','.trim(trim($str,','),',').',' : ''; |
| 217 | } | 217 | } |
| 218 | 218 | ||
| 219 | /** | 219 | /** |
-
请 注册 或 登录 后发表评论