Commit 5feeea7d authored by Quxl's avatar Quxl

x

parent a38128d2
......@@ -11,6 +11,6 @@ public interface FilmReportService {
Map<String, Object> applyTypeReport();
List<Map<String, Object>> directorReport(String playactor_name, Page page);
Map<String, Object> directorDetail(String playactor_name);
List<Map<String, Object>> queryUserViewReport(Page page);
List<Map<String, Object>> queryUserViewReport(String keyword, Page page);
List<Map<String, Object>> queryUserReiewReport(Integer user_id, Page page);
}
......@@ -15,6 +15,7 @@ import com.egolm.common.StringUtil;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page;
import com.egolm.film.api.service.FilmReportService;
import com.egolm.film.util.SqlWhere;
@Service
public class FilmReportServiceImpl implements FilmReportService {
......@@ -178,7 +179,9 @@ public class FilmReportServiceImpl implements FilmReportService {
}
@Override
public List<Map<String, Object>> queryUserViewReport(Page page) {
public List<Map<String, Object>> queryUserViewReport(String keyword, Page page) {
SqlWhere where = new SqlWhere();
where.lk(new String[] {"u.username", "u.realname"}, keyword);
String sql = ""
+ "select "
+ "u.uid, "
......@@ -192,13 +195,13 @@ public class FilmReportServiceImpl implements FilmReportService {
+ "fc_user u, "
+ "fc_review_record rr "
+ "where "
+ "rr.user_id = u.uid "
+ "rr.user_id = u.uid " + StringUtil.join(" and ", " and ", "", "", where.getStringList())
+ "group by "
+ "u.uid, "
+ "u.username, "
+ "u.realname ";
System.out.println(sql);
return jdbcTemplate.limit(sql, page);
return jdbcTemplate.limit(sql, page, where.getObjectArray());
}
@Override
......
......@@ -87,11 +87,11 @@ public class AdminReportController {
@ResponseBody
@PostMapping("view_report")
@ApiOperation("看片统计")
public Object user_view_report(Long index, Long limit, String[] limitKey) {
public Object user_view_report(String keyword, Long index, Long limit, String[] limitKey) {
index = index == null ? 1 : index;
limit = limit == null ? 20 : limit;
Page page = new Page(index, limit, limitKey);
List<Map<String, Object>> list = filmReportService.queryUserViewReport(page);
List<Map<String, Object>> list = filmReportService.queryUserViewReport(keyword, page);
return Rjx.jsonOk().setData(list).setPage(page);
}
......
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