Commit d4b85c63 authored by 刘帅阳's avatar 刘帅阳

修改bug

parent 77c7bfbb
...@@ -46,9 +46,9 @@ public interface CmsNewsRepository extends CyBaseMapper<CmsNews> { ...@@ -46,9 +46,9 @@ public interface CmsNewsRepository extends CyBaseMapper<CmsNews> {
IPage<CmsVideo> listByTopVideoHome(CyPageInfo<CmsNews> paginationUtility, @Param("entity") CmsVideo cmsVideo); IPage<CmsVideo> listByTopVideoHome(CyPageInfo<CmsNews> paginationUtility, @Param("entity") CmsVideo cmsVideo);
IPage<CmsNews> listTopAdmin(CyPageInfo<CmsNews> paginationUtility, CmsNews cmsNews); IPage<CmsNews> listTopAdmin(CyPageInfo<CmsNews> paginationUtility, @Param("entity") CmsNews cmsNews);
IPage<CmsVideo> listTopVideoAdmin(CyPageInfo<CmsNews> paginationUtility, CmsVideo cmsVideo); IPage<CmsVideo> listTopVideoAdmin(CyPageInfo<CmsNews> paginationUtility, @Param("entity") CmsVideo cmsVideo);
IPage<CmsNews> listByClassificationAdmin(CyPageInfo<CmsNews> paginationUtility, CmsNews cmsNews); IPage<CmsNews> listByClassificationAdmin(CyPageInfo<CmsNews> paginationUtility, CmsNews cmsNews);
......
...@@ -332,6 +332,7 @@ public class CmsNewsServiceImpl extends ServiceImpl<CmsNewsRepository, CmsNews> ...@@ -332,6 +332,7 @@ public class CmsNewsServiceImpl extends ServiceImpl<CmsNewsRepository, CmsNews>
} }
return cmsNewsIPage; return cmsNewsIPage;
} }
//登陆后会从 首页/分类我的中进入 1是首页 2是分类和我的 //登陆后会从 首页/分类我的中进入 1是首页 2是分类和我的
if ("1".equals(cmsNews.getSource())) { if ("1".equals(cmsNews.getSource())) {
//超级管理员 //超级管理员
...@@ -346,7 +347,6 @@ public class CmsNewsServiceImpl extends ServiceImpl<CmsNewsRepository, CmsNews> ...@@ -346,7 +347,6 @@ public class CmsNewsServiceImpl extends ServiceImpl<CmsNewsRepository, CmsNews>
} }
return cmsNewsIPage; return cmsNewsIPage;
} }
//当前商家下的文章以及设置为推荐文章 //当前商家下的文章以及设置为推荐文章
IPage<CmsNews> cmsNewsIPage = baseMapper.listTopMerchants(paginationUtility, cmsNews); IPage<CmsNews> cmsNewsIPage = baseMapper.listTopMerchants(paginationUtility, cmsNews);
List<CmsNews> records = cmsNewsIPage.getRecords(); List<CmsNews> records = cmsNewsIPage.getRecords();
...@@ -487,7 +487,6 @@ public class CmsNewsServiceImpl extends ServiceImpl<CmsNewsRepository, CmsNews> ...@@ -487,7 +487,6 @@ public class CmsNewsServiceImpl extends ServiceImpl<CmsNewsRepository, CmsNews>
return cmsVideoIPage; return cmsVideoIPage;
} }
//超级管理员 //超级管理员
//超级管理员
if (CyUserUtil.getAuthenRoleIds().equals(cyInitComp.admin[0])) { if (CyUserUtil.getAuthenRoleIds().equals(cyInitComp.admin[0])) {
//超级管理员 //超级管理员
IPage<CmsVideo> cmsVideoIPage = baseMapper.listTopVideoAdmin(paginationUtility, cmsVideo); IPage<CmsVideo> cmsVideoIPage = baseMapper.listTopVideoAdmin(paginationUtility, cmsVideo);
......
...@@ -377,51 +377,55 @@ ...@@ -377,51 +377,55 @@
</select> </select>
<select id="listTopAdmin" resultType="org.rcisoft.business.cmsnews.entity.CmsNews"> <select id="listTopAdmin" resultType="org.rcisoft.business.cmsnews.entity.CmsNews">
SELECT cn.*, SELECT cn.*,
SUM(cn.click_through_rate) AS readNum SUM(cn.click_through_rate) AS readNum
FROM (SELECT cn.*, FROM (SELECT cn.*,
cpc.click_through_rate AS click_through_rate, cpc.click_through_rate AS click_through_rate,
oi.path AS path oi.path AS path
FROM cms_news cn FROM cms_news cn
LEFT JOIN cms_unit_new_video cunv LEFT JOIN cms_unit_new_video cunv
ON cn.business_id = cunv.news_video_id AND cunv.type = 0 ON cn.business_id = cunv.news_video_id AND cunv.type = 0
LEFT JOIN sys_user_unit suu ON cunv.unit_id = suu.unit_id LEFT JOIN sys_user_unit suu ON cunv.unit_id = suu.unit_id
LEFT JOIN sys_user su ON suu.user_id = su.business_id LEFT JOIN sys_user su ON suu.user_id = su.business_id
LEFT JOIN oss_info oi ON cn.picture_id = oi.business_id LEFT JOIN oss_info oi ON cn.picture_id = oi.business_id
LEFT JOIN cms_price_click cpc LEFT JOIN cms_price_click cpc
ON cpc.news_video_id = cn.business_id AND cpc.del_flag = 0 AND cpc.type = 0 ON cpc.news_video_id = cn.business_id AND cpc.del_flag = 0 AND cpc.type = 0
AND cpc.user_id = su.business_id AND cpc.user_id = su.business_id
WHERE 1 = 1 WHERE 1 = 1
<if test="entity.unitId != null and entity.unitId != ''">
AND cn.del_flag = 0 AND cunv.unit_id = #{entity.unitId}
AND cn.flag = 1 </if>
# AND cn.is_recommended = 1 AND cn.del_flag = 0
GROUP BY cn.business_id, cpc.business_id AND cn.flag = 1
ORDER BY cn.is_top # AND cn.is_recommended = 1
DESC, cn.update_date DESC) cn GROUP BY cn.business_id, cpc.business_id
ORDER BY cn.is_top
DESC, cn.update_date DESC) cn
GROUP BY cn.business_id GROUP BY cn.business_id
</select> </select>
<select id="listTopVideoAdmin" resultType="org.rcisoft.business.cmsvideo.entity.CmsVideo"> <select id="listTopVideoAdmin" resultType="org.rcisoft.business.cmsvideo.entity.CmsVideo">
SELECT cv.*, SELECT cv.*,
SUM(cv.click_through_rate) AS readNum SUM(cv.click_through_rate) AS readNum
FROM (SELECT cv.*, FROM (SELECT cv.*,
cpc.click_through_rate AS click_through_rate, cpc.click_through_rate AS click_through_rate,
oi1.path AS defaultUrl, oi1.path AS defaultUrl,
oi.path AS path oi.path AS path
FROM cms_video cv FROM cms_video cv
LEFT JOIN cms_unit_new_video cunv ON cv.business_id = cunv.news_video_id AND cunv.type = 1 LEFT JOIN cms_unit_new_video cunv ON cv.business_id = cunv.news_video_id AND cunv.type = 1
LEFT JOIN sys_user_unit suu ON cunv.unit_id = suu.unit_id LEFT JOIN sys_user_unit suu ON cunv.unit_id = suu.unit_id
LEFT JOIN sys_user su ON suu.user_id = su.business_id LEFT JOIN sys_user su ON suu.user_id = su.business_id
AND su.del_flag = 0 AND su.del_flag = 0
AND su.flag = 1 AND su.flag = 1
LEFT JOIN cms_price_click cpc LEFT JOIN cms_price_click cpc
ON cpc.news_video_id = cv.business_id AND cpc.del_flag = 0 AND cpc.type = 1 ON cpc.news_video_id = cv.business_id AND cpc.del_flag = 0 AND cpc.type = 1
LEFT JOIN oss_info oi ON cv.video_url_id = oi.business_id LEFT JOIN oss_info oi ON cv.video_url_id = oi.business_id
LEFT JOIN oss_info oi1 ON cv.default_url = oi1.business_id LEFT JOIN oss_info oi1 ON cv.default_url = oi1.business_id
WHERE 1 = 1 WHERE 1 = 1
<if test="entity.unitId != null and entity.unitId != ''">
AND cv.del_flag = 0 AND cunv.unit_id = #{entity.unitId}
GROUP BY cv.business_id, cpc.business_id </if>
order by cv.flag DESC, cv.update_date DESC) cv AND cv.del_flag = 0
GROUP BY cv.business_id, cpc.business_id
order by cv.flag DESC, cv.update_date DESC) cv
GROUP BY cv.business_id GROUP BY cv.business_id
</select> </select>
<select id="listByClassificationAdmin" resultType="org.rcisoft.business.cmsnews.entity.CmsNews"> <select id="listByClassificationAdmin" resultType="org.rcisoft.business.cmsnews.entity.CmsNews">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment