作者 lyh

gx

@@ -72,9 +72,6 @@ class BlogCategoryLogic extends BaseLogic @@ -72,9 +72,6 @@ class BlogCategoryLogic extends BaseLogic
72 //随机获取最后一级id 72 //随机获取最后一级id
73 $replacement = $this->getLastId($id); 73 $replacement = $this->getLastId($id);
74 if(!empty($blogList)){ 74 if(!empty($blogList)){
75 - foreach ($blogList as $v){  
76 - str_replace($pid,$replacement);  
77 - }  
78 //存在博客时,移动所有博客到当前分类最后一级 75 //存在博客时,移动所有博客到当前分类最后一级
79 $blogModel->where('category_id', 'like', '%,' . $pid . ',%') 76 $blogModel->where('category_id', 'like', '%,' . $pid . ',%')
80 ->update(['category_id' => DB::raw("REPLACE(category_id, ',$pid,', ',$replacement,')")]); 77 ->update(['category_id' => DB::raw("REPLACE(category_id, ',$pid,', ',$replacement,')")]);