fix bug
This commit is contained in:
@@ -75,7 +75,9 @@ public class MTrainEducationController {
|
|||||||
""");
|
""");
|
||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
cnd.and("tea.disabled", "=", 0);
|
cnd.and("tea.disabled", "=", 0);
|
||||||
cnd.and(new Static("tea.id = (select albumId from train_edu_video order by createdAt desc LIMIT 0,1)"));
|
// cnd.and(new Static("tea.id = (select albumId from train_edu_video order by createdAt desc LIMIT 0,1)"));
|
||||||
|
cnd.and(new Static("CURDATE() >= tev.startDate"));
|
||||||
|
cnd.and(new Static("CURDATE() <= tev.endDate"));
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
sql.setCallback(Sqls.callback.map());
|
sql.setCallback(Sqls.callback.map());
|
||||||
dao.execute(sql);
|
dao.execute(sql);
|
||||||
@@ -108,8 +110,10 @@ public class MTrainEducationController {
|
|||||||
$condition
|
$condition
|
||||||
""");
|
""");
|
||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
cnd.and("tea.disabled","=",0);
|
cnd.and("tea.disabled", "=", 0);
|
||||||
cnd.andEX("tea.typeId", "=", typeId);
|
cnd.andEX("tea.typeId", "=", typeId);
|
||||||
|
cnd.and(new Static("CURDATE() >= tev.startDate"));
|
||||||
|
cnd.and(new Static("CURDATE() <= tev.endDate"));
|
||||||
cnd.groupBy("tea.id");
|
cnd.groupBy("tea.id");
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
return baseService.listPageMap(pageNumber, pageSize, sql);
|
return baseService.listPageMap(pageNumber, pageSize, sql);
|
||||||
@@ -234,7 +238,9 @@ public class MTrainEducationController {
|
|||||||
@At
|
@At
|
||||||
@ViReturn
|
@ViReturn
|
||||||
@RequiresAuthentication
|
@RequiresAuthentication
|
||||||
public Object getMyWatchRecord(@Param(value = "albumId", required = false) String albumId) {
|
public Object getMyWatchRecord(@Param(value = "albumId") String albumId) {
|
||||||
|
TrainEduVideo video = dao.fetch(TrainEduVideo.class, Cnd.where("albumId", "=", albumId));
|
||||||
|
|
||||||
Sql sql = Sqls.create("""
|
Sql sql = Sqls.create("""
|
||||||
SELECT
|
SELECT
|
||||||
tevwr.*
|
tevwr.*
|
||||||
@@ -245,6 +251,8 @@ public class MTrainEducationController {
|
|||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
cnd.andEX("tevwr.albumId", "=", albumId);
|
cnd.andEX("tevwr.albumId", "=", albumId);
|
||||||
cnd.andEX("tevwr.userId", "=", ShiroUtil.getPrincipalProperty("id"));
|
cnd.andEX("tevwr.userId", "=", ShiroUtil.getPrincipalProperty("id"));
|
||||||
|
cnd.and("tevwr.watchTime", ">=", video.getStartDate());
|
||||||
|
cnd.and("tevwr.watchTime", "<=", video.getEndDate());
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
return baseService.listMap(sql);
|
return baseService.listMap(sql);
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -100,6 +100,8 @@ public class TrainEduStatisticsVideoController {
|
|||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
cnd.and("tevwr.albumId", "=", albumId);
|
cnd.and("tevwr.albumId", "=", albumId);
|
||||||
cnd.and(new Static("IF(tea.createType = 1, u.unionId = tea.unionId , 1=1)"));
|
cnd.and(new Static("IF(tea.createType = 1, u.unionId = tea.unionId , 1=1)"));
|
||||||
|
cnd.and(new Static("tevwr.watchTime >= tev.startDate"));
|
||||||
|
cnd.and(new Static("tevwr.watchTime <= tev.endDate"));
|
||||||
cnd.groupBy("tevwr.userId");
|
cnd.groupBy("tevwr.userId");
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
Pagination pagination = baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||||
@@ -175,11 +177,12 @@ public class TrainEduStatisticsVideoController {
|
|||||||
Cnd cnd = Cnd.NEW();
|
Cnd cnd = Cnd.NEW();
|
||||||
cnd.and("tevwr.albumId", "=", albumId);
|
cnd.and("tevwr.albumId", "=", albumId);
|
||||||
cnd.and(new Static("IF(tea.createType = 1, u.unionId = tea.unionId , 1=1)"));
|
cnd.and(new Static("IF(tea.createType = 1, u.unionId = tea.unionId , 1=1)"));
|
||||||
|
cnd.and(new Static("tevwr.watchTime >= tev.startDate"));
|
||||||
|
cnd.and(new Static("tevwr.watchTime <= tev.endDate"));
|
||||||
cnd.groupBy("tevwr.userId");
|
cnd.groupBy("tevwr.userId");
|
||||||
sql.setCondition(cnd);
|
sql.setCondition(cnd);
|
||||||
List<NutMap> list = baseService.listMap(sql);
|
List<NutMap> list = baseService.listMap(sql);
|
||||||
|
|
||||||
|
|
||||||
List<ExcelExportEntity> excelExportEntities = new ArrayList<>();
|
List<ExcelExportEntity> excelExportEntities = new ArrayList<>();
|
||||||
excelExportEntities.add(new ExcelExportEntity("序号","no",10));
|
excelExportEntities.add(new ExcelExportEntity("序号","no",10));
|
||||||
excelExportEntities.add(new ExcelExportEntity("姓名","username",20));
|
excelExportEntities.add(new ExcelExportEntity("姓名","username",20));
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import lombok.EqualsAndHashCode;
|
|||||||
import org.nutz.dao.entity.annotation.*;
|
import org.nutz.dao.entity.annotation.*;
|
||||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Table
|
@Table
|
||||||
@Data
|
@Data
|
||||||
@@ -70,4 +72,14 @@ public class TrainEduVideo extends BaseModel {
|
|||||||
@ColDefine(type = ColType.INT)
|
@ColDefine(type = ColType.INT)
|
||||||
private Integer qualifiedNum;
|
private Integer qualifiedNum;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@Comment("开始时间")
|
||||||
|
@ColDefine(type = ColType.DATE)
|
||||||
|
private Date startDate;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
@Comment("结束时间")
|
||||||
|
@ColDefine(type = ColType.DATE)
|
||||||
|
private Date endDate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,34 +99,34 @@ layout("/mobile/platform.html"){
|
|||||||
webkit-playsinline>
|
webkit-playsinline>
|
||||||
</video>
|
</video>
|
||||||
|
|
||||||
<!-- <div v-if="!isPlay" style=" height: 100%;-->
|
<!-- <div v-if="!isPlay" style=" height: 100%;-->
|
||||||
<!-- background: #000;-->
|
<!-- background: #000;-->
|
||||||
<!-- position: absolute;-->
|
<!-- position: absolute;-->
|
||||||
<!-- top: 0;-->
|
<!-- top: 0;-->
|
||||||
<!-- left: 0;-->
|
<!-- left: 0;-->
|
||||||
<!-- right: 0;-->
|
<!-- right: 0;-->
|
||||||
<!-- bottom: 0;">-->
|
<!-- bottom: 0;">-->
|
||||||
<!-- <van-image-->
|
<!-- <van-image-->
|
||||||
<!-- style="width: 90%;-->
|
<!-- style="width: 90%;-->
|
||||||
<!-- height: 100%;-->
|
<!-- height: 100%;-->
|
||||||
<!-- z-index: 999;"-->
|
<!-- z-index: 999;"-->
|
||||||
<!-- fit="contain"-->
|
<!-- fit="contain"-->
|
||||||
<!-- :src="FILE_DOMAIN+'/fileStreamPreview?id='+albumInfo.cover"-->
|
<!-- :src="FILE_DOMAIN+'/fileStreamPreview?id='+albumInfo.cover"-->
|
||||||
<!-- ></van-image>-->
|
<!-- ></van-image>-->
|
||||||
<!-- <div class="tcp-skin">-->
|
<!-- <div class="tcp-skin">-->
|
||||||
<!-- <div class="vjs-big-play-button">-->
|
<!-- <div class="vjs-big-play-button">-->
|
||||||
<!-- <div class="vjs-button-icon">-->
|
<!-- <div class="vjs-button-icon">-->
|
||||||
<!-- <svg height="100%" width="100%" viewBox="0 0 484 348">-->
|
<!-- <svg height="100%" width="100%" viewBox="0 0 484 348">-->
|
||||||
<!-- <path class="draw-fill" transform="translate(4 4)"-->
|
<!-- <path class="draw-fill" transform="translate(4 4)"-->
|
||||||
<!-- d="M383,124C350-42,122.3-40.5,90.6,123.5c-110.4,18.5-131,185,.6,216.5H381.6C519.7,310.7,494.1,137.8,383,124Z"></path>-->
|
<!-- d="M383,124C350-42,122.3-40.5,90.6,123.5c-110.4,18.5-131,185,.6,216.5H381.6C519.7,310.7,494.1,137.8,383,124Z"></path>-->
|
||||||
<!-- <path transform="translate(4 4)"-->
|
<!-- <path transform="translate(4 4)"-->
|
||||||
<!-- d="M200.4,110.2c-9.4-5.8-19.6,2.7-19.4,11.7V256.2c0,8,10.4,16.7,19.4,10.8,2.2-1.4,111.8-65.9,114-67.3,7.4-4,10.1-15.8,0-22.2Z"-->
|
<!-- d="M200.4,110.2c-9.4-5.8-19.6,2.7-19.4,11.7V256.2c0,8,10.4,16.7,19.4,10.8,2.2-1.4,111.8-65.9,114-67.3,7.4-4,10.1-15.8,0-22.2Z"-->
|
||||||
<!-- style="fill:#fff ;"></path>-->
|
<!-- style="fill:#fff ;"></path>-->
|
||||||
<!-- </svg>-->
|
<!-- </svg>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<van-tabs v-model="tabIndex" sticky>
|
<van-tabs v-model="tabIndex" sticky>
|
||||||
@@ -353,7 +353,9 @@ layout("/mobile/platform.html"){
|
|||||||
// })
|
// })
|
||||||
// },
|
// },
|
||||||
async getMyWatchRecord() {
|
async getMyWatchRecord() {
|
||||||
const {data} = await $.get('/mobile/trainEducation/getMyWatchRecord')
|
const {data} = await $.get('/mobile/trainEducation/getMyWatchRecord', {
|
||||||
|
albumId: this.albumId
|
||||||
|
})
|
||||||
this.watchRecordList = data
|
this.watchRecordList = data
|
||||||
},
|
},
|
||||||
getWatchStatus(video) {
|
getWatchStatus(video) {
|
||||||
|
|||||||
@@ -144,6 +144,26 @@ layout("/layouts/platform.html"){
|
|||||||
<el-input-number :min="1" :max="1000" v-model="formData.qualifiedNum"></el-input-number>
|
<el-input-number :min="1" :max="1000" v-model="formData.qualifiedNum"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="开始时间" prop="startDate">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.startDate"
|
||||||
|
type="date"
|
||||||
|
placeholder="选择日期"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
style="width: 100%;">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="结束时间" prop="endDate">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.endDate"
|
||||||
|
type="date"
|
||||||
|
placeholder="选择日期"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
style="width: 100%;">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="是否启用" prop="disabled">
|
<el-form-item label="是否启用" prop="disabled">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="formData.disabled"
|
v-model="formData.disabled"
|
||||||
@@ -231,13 +251,16 @@ layout("/layouts/platform.html"){
|
|||||||
{prop: 'createUserName', label: '上传人'},
|
{prop: 'createUserName', label: '上传人'},
|
||||||
{prop: 'createTime', label: '上传时间', sortable: true},
|
{prop: 'createTime', label: '上传时间', sortable: true},
|
||||||
{prop: 'disabled', label: '视频状态', sortable: true},
|
{prop: 'disabled', label: '视频状态', sortable: true},
|
||||||
|
{prop: 'startDate', label: '开始时间', sortable: true},
|
||||||
|
{prop: 'endDate', label: '结束时间', sortable: true}
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
albumId: [{required: true, message: '请选择所属专辑', trigger: ['change', 'blur']}],
|
albumId: [{required: true, message: '请选择所属专辑', trigger: ['change', 'blur']}],
|
||||||
title: [{required: true, message: '请选择视频标题', trigger: ['change', 'blur']}],
|
title: [{required: true, message: '请选择视频标题', trigger: ['change', 'blur']}],
|
||||||
url: [{required: true, message: '请上传视频文件', trigger: ['change', 'blur']}],
|
url: [{required: true, message: '请上传视频文件', trigger: ['change', 'blur']}],
|
||||||
sortNo: [{required: true, message: '请输入排序编号', trigger: ['change', 'blur']}]
|
sortNo: [{required: true, message: '请输入排序编号', trigger: ['change', 'blur']}],
|
||||||
|
startDate: [{required: true, message: '请输入开始时间', trigger: ['change', 'blur']}],
|
||||||
|
endDate: [{required: true, message: '请输入结束时间', trigger: ['change', 'blur']}]
|
||||||
},
|
},
|
||||||
albumList: [],
|
albumList: [],
|
||||||
fileList: [],
|
fileList: [],
|
||||||
|
|||||||
Reference in New Issue
Block a user