Commit ec793150 authored by daniel's avatar daniel

fix(cmpt): guide赛事列表更新

parent 3765abd6
......@@ -38,4 +38,6 @@ public class News implements Serializable {
private Double lat;
private Double lng;
private int openType;
// 排序
private int sort;
}
\ No newline at end of file
......@@ -211,15 +211,29 @@
<select id="countCommitteeCmpt" resultType="long">
select count(1)
from gk_cmpt a left join common.neucmpt b on a.cmpt_id=b.gtCmptId
from (
select a.cmpt_id
from gk_cmpt a
left join common.neucmpt b on a.cmpt_id=b.gtCmptId
left join common.neuuser nu on b.neuUserId=nu.neuUserId
left join raceenroll.competition c on b.gcmptid=c.cmptid
where a.del_flag=0
<include refid="committee-cmpt-where-sql"/>
union all
select a.cmpt_id
from gk_cmpt a
left join common.neucmpt b on a.cmpt_id=b.gtCmptId
left join common.neuuser nu on nu.neuUserId=b.committeeNeuUserId
left join raceenroll.competition c on b.gcmptid=c.cmptid
where a.del_flag=0
<include refid="committee-cmpt-where-sql"/>
) tmp
</select>
<select id="queryCommitteeCmpt" resultType="com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt">
select a.cmpt_id,
(select a.cmpt_id,
a.cmpt_name as cmptName,
a.logo,
b.gCmptId,
......@@ -239,11 +253,40 @@
c.province as province,
c.area as area,
c.location as location
from gk_cmpt a left join common.neucmpt b on a.cmpt_id=b.gtCmptId
from gk_cmpt a
left join common.neucmpt b on a.cmpt_id=b.gtCmptId
left join common.neuuser nu on b.neuUserId=nu.neuUserId
left join raceenroll.competition c on b.gcmptid=c.cmptid
where a.del_flag=0
<include refid="committee-cmpt-where-sql"/>
order by c.startTime desc
<include refid="committee-cmpt-where-sql"/>)
union all
(select a.cmpt_id,
a.cmpt_name as cmptName,
a.logo,
b.gCmptId,
date_format(start_time,'%Y-%m-%d') startTime,
date_format(end_time,'%Y-%m-%d') endTime,
date_format(a.start_time,'%Y-%m-%d %H:%i:%s') as startTimeStr,
date_format(a.end_time,'%Y-%m-%d %H:%i:%s') as endTimeStr,
date_format(c.openTime,'%Y-%m-%d %H:%i:%s') as openTime,
date_format(c.deadLine,'%Y-%m-%d %H:%i:%s') as deadLine,
a.bg_color as cmptbgColor,
a.create_by AS "createBy",
a.create_date AS "createDate",
a.update_by AS "updateBy",
a.update_date AS "updateDate",
a.del_flag AS "delFlag",
c.city as city,
c.province as province,
c.area as area,
c.location as location
from gk_cmpt a
left join common.neucmpt b on a.cmpt_id=b.gtCmptId
left join common.neuuser nu on nu.neuUserId =b.committeeNeuUserId
left join raceenroll.competition c on b.gcmptid=c.cmptid
where a.del_flag=0
<include refid="committee-cmpt-where-sql"/>)
order by startTime desc
limit #{page.offset},#{page.size}
</select>
<sql id="committee-cmpt-where-sql">
......@@ -257,7 +300,7 @@
and now() >= c.startTime and c.endTime >= now()
</if>
<if test="param.userId > 0">
and c.createUserId=#{param.userId}
and nu.gUserId=#{param.userId}
</if>
<if test="param.userId lt 0">
AND c.createUserId NOT IN (SELECT user_id from gksite.gk_app_info WHERE user_id>0)
......
......@@ -497,6 +497,14 @@
placeholder="小程序appId" id="appId" cols="50" rows="10"></textarea>
</div>
</div>
<div class="input-group" id="sort-input"
style="height: 120px;margin-bottom: 10px;">
<label for="">排序</label>
<div>
<input type="number" style="float: right;" class="title-area" type="text" placeholder="数字越小越靠前"
id="sort" ></input>
</div>
</div>
<div class="input-group hidden" id="lat-input"
style="height: 120px;margin-bottom: 10px;">
<label for="">经度</label>
......
......@@ -54,6 +54,7 @@ $(document).ready(function () {
const path = $('#path').val();
const lat = $('#lat').val();
const lng = $('#lng').val();
const sort = $('#sort').val();
const appId = $('#appId').val();
if (!content) {
layer.alert("内容不能为空!");
......@@ -77,7 +78,8 @@ $(document).ready(function () {
openType: openType,
path: path,
lat: lat ?? 0,
lng: lng ?? 0
lng: lng ?? 0,
sort: sort ?? 1
}),
success: function (data) {
layer.msg('保存成功')
......@@ -355,6 +357,7 @@ function getNews(id) {
$('#lat').val(data.content.lat);
$('#lng').val(data.content.lng);
$('#appId').val(data.content.appId);
$('#sort').val(data.content.sort);
updateViews(data.content.openType)
if (data.content.cover) {
$('.cover').css('background-image', "url(" + data.content.cover + ")")
......
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