|
@@ -42,14 +42,14 @@ public class BrowseAction {
|
|
|
|
|
|
|
|
private void saveBrowseRecordsEntity(BrowseRecordsEntity entity) {
|
|
private void saveBrowseRecordsEntity(BrowseRecordsEntity entity) {
|
|
|
browseRecordsBiz.save(entity);
|
|
browseRecordsBiz.save(entity);
|
|
|
- browseRecordsBiz.update("DELETE FROM mdiy_form_browse_records WHERE id NOT IN (SELECT id FROM (SELECT id FROM mdiy_form_browse_records ORDER BY create_date DESC LIMIT ?) AS tmp)", 30);
|
|
|
|
|
|
|
+ browseRecordsBiz.update("DELETE FROM mdiy_form_browse_records WHERE id NOT IN (SELECT id FROM (SELECT id FROM mdiy_form_browse_records ORDER BY id desc LIMIT ?) AS tmp)", 30);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void incrementDailyVisits() {
|
|
private void incrementDailyVisits() {
|
|
|
Date now = new Date();
|
|
Date now = new Date();
|
|
|
String time = DatePattern.NORM_DATE_FORMAT.format(now);
|
|
String time = DatePattern.NORM_DATE_FORMAT.format(now);
|
|
|
if (day.contains(time)) {
|
|
if (day.contains(time)) {
|
|
|
- browseBiz.update("update mdiy_form_browse set BROWSE_VISITS = BROWSE_VISITS + 1 where BROWSE_DATA = now()");
|
|
|
|
|
|
|
+ browseBiz.update("update mdiy_form_browse set BROWSE_VISITS = BROWSE_VISITS + 1 where BROWSE_DATA = ?", time);
|
|
|
} else {
|
|
} else {
|
|
|
BrowseEntity browseEntity = browseBiz.getOne(new LambdaQueryWrapper<>(BrowseEntity.class).eq(BrowseEntity::getBrowseData, time));
|
|
BrowseEntity browseEntity = browseBiz.getOne(new LambdaQueryWrapper<>(BrowseEntity.class).eq(BrowseEntity::getBrowseData, time));
|
|
|
if (browseEntity == null) {
|
|
if (browseEntity == null) {
|
|
@@ -65,22 +65,14 @@ public class BrowseAction {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void incrementVisits(BrowseRecordsEntity entity) {
|
|
private void incrementVisits(BrowseRecordsEntity entity) {
|
|
|
- String sql = "";
|
|
|
|
|
- String id = null;
|
|
|
|
|
if (StrUtil.isNotBlank(entity.getRecordsEnterpriseId())) {
|
|
if (StrUtil.isNotBlank(entity.getRecordsEnterpriseId())) {
|
|
|
- id = entity.getRecordsEnterpriseId();
|
|
|
|
|
- sql = "update mdiy_form_enterprise set ENTERPRISE_VISITS = ifnull(ENTERPRISE_VISITS, 0) + 1 where id = ?";
|
|
|
|
|
|
|
+ browseBiz.update("update mdiy_form_enterprise set ENTERPRISE_VISITS = ifnull(ENTERPRISE_VISITS, 0) + 1 where id = ?", entity.getRecordsEnterpriseId());
|
|
|
}
|
|
}
|
|
|
if (StrUtil.isNotBlank(entity.getRecordsDesignId())) {
|
|
if (StrUtil.isNotBlank(entity.getRecordsDesignId())) {
|
|
|
- id = entity.getRecordsDesignId();
|
|
|
|
|
- sql = "update mdiy_form_design set DESIGN_VISITS = ifnull(DESIGN_VISITS, 0) + 1 where id = ?";
|
|
|
|
|
|
|
+ browseBiz.update("update mdiy_form_design set DESIGN_VISITS = ifnull(DESIGN_VISITS, 0) + 1 where id = ?", entity.getRecordsDesignId());
|
|
|
}
|
|
}
|
|
|
if (StrUtil.isNotBlank(entity.getRecordsProductsId())) {
|
|
if (StrUtil.isNotBlank(entity.getRecordsProductsId())) {
|
|
|
- id = entity.getRecordsProductsId();
|
|
|
|
|
- sql = "update mdiy_form_enterprise_products set PRODUCT_VISITS = ifnull(PRODUCT_VISITS, 0) + 1 where id = ?";
|
|
|
|
|
- }
|
|
|
|
|
- if (StrUtil.isNotBlank(sql) && StrUtil.isNotBlank(id)) {
|
|
|
|
|
- browseBiz.update(sql, id);
|
|
|
|
|
|
|
+ browseBiz.update("update mdiy_form_enterprise_products set PRODUCT_VISITS = ifnull(PRODUCT_VISITS, 0) + 1 where id = ?", entity.getRecordsProductsId());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|