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

修改

parent 47dbb92c
......@@ -201,6 +201,7 @@ public class CmsNewsServiceImpl extends ServiceImpl<CmsNewsRepository, CmsNews>
if (ObjectUtil.isNotNull(check) && !check.getBusinessId().equals(cmsNews.getBusinessId())) {
throw new CyServiceException(500, "权重已存在");
} else {
cmsNews.setUpdateDate(new Date());
int line = baseMapper.updateById(cmsNews);
log.debug(CyUserUtil.getAuthenUsername() + "修改了ID为" + cmsNews.getBusinessId() + "的文章表信息");
return new CyPersistModel(line);
......@@ -324,8 +325,8 @@ public class CmsNewsServiceImpl extends ServiceImpl<CmsNewsRepository, CmsNews>
public IPage<CmsNews> listMiniProgram(CyPageInfo<CmsNews> paginationUtility, CmsNews cmsNews) {
//未登陆
if (CyUserUtil.getAuthenUsername() == null) {
cmsNews.setIsTop(1);
IPage<CmsNews> cmsNewsIPage = baseMapper.noLoginlistTop(paginationUtility, cmsNews); List<CmsNews> records = cmsNewsIPage.getRecords();
IPage<CmsNews> cmsNewsIPage = baseMapper.noLoginlistTop(paginationUtility, cmsNews);
List<CmsNews> records = cmsNewsIPage.getRecords();
for (CmsNews cmsNews1 : records) {
if (cmsNews1.getPath() != null) {
cmsNews1.setPath(global.getBase_Discovery() + cmsNews1.getPath());
......@@ -334,7 +335,7 @@ public class CmsNewsServiceImpl extends ServiceImpl<CmsNewsRepository, CmsNews>
return cmsNewsIPage;
}
//登陆后会从 首页/分类我的中进入 1是首页 2是分类和我的
if ("1".equals(cmsNews.getSource())){
if ("1".equals(cmsNews.getSource())) {
//当前商家下的文章以及设置为推荐文章
IPage<CmsNews> cmsNewsIPage = baseMapper.listTopMerchants(paginationUtility, cmsNews);
List<CmsNews> records = cmsNewsIPage.getRecords();
......@@ -457,7 +458,7 @@ public class CmsNewsServiceImpl extends ServiceImpl<CmsNewsRepository, CmsNews>
return cmsVideoIPage;
}
//登陆后
cmsVideo.setUserId(Integer.valueOf(CyUserUtil.getAuthenBusinessId()));
cmsVideo.setUserId(Integer.valueOf(CyUserUtil.getAuthenBusinessId()));
//校验是否包含商家信息
if (StringUtils.isEmpty(cmsVideo.getUnitId())) {
......@@ -469,7 +470,7 @@ public class CmsNewsServiceImpl extends ServiceImpl<CmsNewsRepository, CmsNews>
if (cmsNews1.getPath() != null) {
cmsNews1.setPath(global.getBase_Discovery() + cmsNews1.getPath());
}
//封面
//封面
if (cmsNews1.getDefaultUrl() != null) {
cmsNews1.setDefaultUrl(global.getBase_Discovery() + cmsNews1.getDefaultUrl());
}
......
......@@ -73,7 +73,7 @@ cy:
# 是否开启登录拦截
secure: false
# token存活时间(30分钟)
ttl: 10
ttl: 1800
security:
enable: true
permission: false
......
......@@ -141,11 +141,10 @@
FROM cms_banner cb
LEFT JOIN oss_info oi ON oi.business_id = cb.banner_picture
LEFT JOIN cms_banner_unit cbu on cbu.cms_banner_id = cb.business_id
LEFT JOIN sys_user_unit suu on suu.unit_id = cbu.sys_unit_id
WHERE 1 = 1
AND cb.del_flag = 0
AND cb.flag = 1
AND suu.user_id = #{entity.userId}
AND cbu.sys_unit_id = #{entity.unitId}
</select>
<select id="visitorPagination" resultType="org.rcisoft.business.cmsbanner.entity.CmsBanner">
SELECT oi.path AS url,
......
......@@ -208,6 +208,7 @@
AND cn.flag = 1
and cpc.business_id IS NOT NULL
GROUP BY cn.business_id
ORDER BY cn.update_date DESC
</select>
<select id="selectDictionaryControl" resultType="java.lang.Integer">
SELECT dict_value
......@@ -300,7 +301,7 @@
AND cv.home_display = #{entity.homeDisplay}
AND cv.del_flag = 0
GROUP BY cv.business_id
order by cv.business_id DESC
order by cv.flag DESC, cv.update_date DESC
</select>
<select id="noLoginlistTop" resultType="org.rcisoft.business.cmsnews.entity.CmsNews">
SELECT cn.*,
......@@ -311,15 +312,16 @@
LEFT JOIN sys_user su ON suu.user_id = su.business_id
LEFT JOIN oss_info oi ON cn.picture_id = oi.business_id
WHERE 1 = 1
AND cn.is_top = #{entity.isTop}
AND cn.is_recommended = 1
AND cn.del_flag = 0
AND cn.flag = 1
GROUP BY cn.business_id
ORDER BY cn.is_top DESC, cn.update_date DESC
</select>
<select id="listTopMerchants" resultType="org.rcisoft.business.cmsnews.entity.CmsNews">
SELECT cn.*,
SUM(cpc.click_through_rate) AS readNum,
oi.path AS path
SUM(DISTINCT cpc.click_through_rate) AS readNum,
oi.path AS path
FROM cms_news cn
LEFT JOIN cms_unit_new_video cunv 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
......@@ -335,12 +337,13 @@
AND cn.flag = 1
# AND cn.is_recommended = 1
GROUP BY cn.business_id
ORDER BY cn.is_top DESC, cn.update_date DESC
</select>
<select id="listByTopVideoHome" resultType="org.rcisoft.business.cmsvideo.entity.CmsVideo">
SELECT cv.*,
sum(cpc.click_through_rate) AS readNum,
oi1.path AS defaultUrl,
oi.path AS path
sum(DISTINCT cpc.click_through_rate) AS readNum,
oi1.path AS defaultUrl,
oi.path AS path
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 sys_user_unit suu ON cunv.unit_id = suu.unit_id
......@@ -355,8 +358,7 @@
WHERE 1 = 1
AND cunv.unit_id = #{entity.unitId}
AND cv.del_flag = 0
AND cv.flag = 1
GROUP BY cv.business_id
order by cv.business_id DESC
order by cv.flag DESC, cv.update_date DESC
</select>
</mapper>
......@@ -123,9 +123,9 @@
AND su.del_flag = 0
AND su.flag = 1
AND cv.del_flag = 0
AND cv.flag = 1
and cpc.business_id IS NOT NULL
GROUP BY cv.business_id
order by cv.create_date DESC
</select>
<select id="superAdminPaginatedQuery" resultType="org.rcisoft.business.cmsvideo.entity.CmsVideo">
SELECT DISTINCT cv.*,
......@@ -155,7 +155,7 @@
and release_time &lt;= #{entity.endTime}
</if>
GROUP BY cv.business_id
ORDER BY cv.business_id DESC
ORDER BY cv.update_date DESC
</select>
<select id="businessAdminsPaginatedQuery" resultType="org.rcisoft.business.cmsvideo.entity.CmsVideo">
SELECT DISTINCT cv.*,
......
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