diff --git a/app/common.php b/app/common.php index 071cd75..0a6aee1 100644 --- a/app/common.php +++ b/app/common.php @@ -1496,35 +1496,6 @@ if (!function_exists('getOtherCategoryCategoryId')) { if (empty($siblingCates)) { return []; } - - // 4. 查询每个分类下最新一条内容 - $cateSubModel = new \app\model\CategorySubContent(); - $subContentModel = new \app\model\SubContent(); - - foreach ($siblingCates as &$cate) { - $cateSubIds = $cateSubModel->where('category_id', $cate['id']) - ->where('seller_id', $sellerId) - ->column('sub_content_id'); - - if (!empty($cateSubIds)) { - $content = $subContentModel->whereIn('id', $cateSubIds) - ->where('seller_id', $sellerId) - ->where('is_del', 1) - ->with(['thumbnail' => function ($query) { - $query->field('id,name,url,type'); - }]) - ->field('id,title,description') - ->order('publish_time desc') - ->limit($limit) - ->select() - ->toArray(); - - $cate['articles'] = $content; - } else { - $cate['articles'] = []; - } - } - return $siblingCates; } catch (\Exception $e) { return [];