|
@@ -846,9 +846,18 @@ def content_rank(user_id, start, end, page, page_size, order, order_by, book, ch
|
|
op_time_small = f" and dt<='{end}' " if end else ''
|
|
op_time_small = f" and dt<='{end}' " if end else ''
|
|
|
|
|
|
db = MysqlUtils().dm
|
|
db = MysqlUtils().dm
|
|
- total = db.getData(f"select sum(if(title,1,0))+sum(if(description,1,0)) from dw_image_cost_day dicd ")[0][0]
|
|
|
|
- title_totle = db.getData(f"select sum(if(title,1,0)) from dw_image_cost_day dicd ")[0][0]
|
|
|
|
- des_totle = db.getData(f"select sum(if(description,1,0)) from dw_image_cost_day dicd ")[0][0]
|
|
|
|
|
|
+
|
|
|
|
+ title_totle = db.getData(f'''select count(*) from dw_image_cost_day dicd
|
|
|
|
+where REPLACE(REPLACE(title , CHAR(10), ''), CHAR(13), '') is not null
|
|
|
|
+ and (1=1 {op1} {op4} {op10} {op11} {op12} {op_or1})
|
|
|
|
+ {op_time_bigger} {op_time_small}
|
|
|
|
+''')[0][0]
|
|
|
|
+ des_totle = db.getData(f'''select count(*) from dw_image_cost_day dicd
|
|
|
|
+ where REPLACE(REPLACE(description , CHAR(10), ''), CHAR(13), '') is not null
|
|
|
|
+ and (1=1 {op1} {op4} {op10} {op11} {op12} {op_or1})
|
|
|
|
+ {op_time_bigger} {op_time_small}
|
|
|
|
+''')[0][0]
|
|
|
|
+ total = des_totle + title_totle
|
|
end_title = int((page * page_size) / total * title_totle) + 1
|
|
end_title = int((page * page_size) / total * title_totle) + 1
|
|
start_title = int(((page - 1) * page_size) / total * title_totle)
|
|
start_title = int(((page - 1) * page_size) / total * title_totle)
|
|
end_des = int((page * page_size) / total * des_totle) + 1
|
|
end_des = int((page * page_size) / total * des_totle) + 1
|
|
@@ -878,7 +887,7 @@ def content_rank(user_id, start, end, page, page_size, order, order_by, book, ch
|
|
null as updateBy,
|
|
null as updateBy,
|
|
use_times as userTimes
|
|
use_times as userTimes
|
|
from dw_image_cost_day
|
|
from dw_image_cost_day
|
|
- where replace (preview_url,' ,','') !=''
|
|
|
|
|
|
+ where REPLACE(REPLACE(title, CHAR(10), ''), CHAR(13), '') is not null
|
|
and (1=1 {op1} {op4} {op10} {op11} {op12} {op_or1})
|
|
and (1=1 {op1} {op4} {op10} {op11} {op12} {op_or1})
|
|
{op_time_bigger} {op_time_small}
|
|
{op_time_bigger} {op_time_small}
|
|
limit {start_title} , {end_title}) as a
|
|
limit {start_title} , {end_title}) as a
|
|
@@ -906,7 +915,7 @@ select * from (select
|
|
null as updateBy,
|
|
null as updateBy,
|
|
use_times as userTimes
|
|
use_times as userTimes
|
|
from dw_image_cost_day
|
|
from dw_image_cost_day
|
|
- where replace (preview_url,' ,','') !=''
|
|
|
|
|
|
+ where REPLACE(REPLACE(title, CHAR(10), ''), CHAR(13), '') is not null
|
|
and (1=1 {op1} {op4} {op10} {op11} {op12} {op_or1})
|
|
and (1=1 {op1} {op4} {op10} {op11} {op12} {op_or1})
|
|
{op_time_bigger} {op_time_small}
|
|
{op_time_bigger} {op_time_small}
|
|
limit {start_des} , {end_des}
|
|
limit {start_des} , {end_des}
|