|
@@ -859,16 +859,12 @@ where REPLACE(REPLACE(title , CHAR(10), ''), CHAR(13), '') is not null and le
|
|
''')[0][0]
|
|
''')[0][0]
|
|
total = des_totle + title_totle
|
|
total = des_totle + title_totle
|
|
if total:
|
|
if total:
|
|
- 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
|
|
|
|
start_des = int(((page - 1) * page_size) / total * des_totle)
|
|
start_des = int(((page - 1) * page_size) / total * des_totle)
|
|
else:
|
|
else:
|
|
- end_title = 0
|
|
|
|
start_title = 0
|
|
start_title = 0
|
|
- end_des = 0
|
|
|
|
start_des = 0
|
|
start_des = 0
|
|
- print(page, page_size, start_title, end_title, start_des, end_des)
|
|
|
|
|
|
+ print(page, page_size, start_title, start_des)
|
|
|
|
|
|
sql = f"""
|
|
sql = f"""
|
|
select * from (select
|
|
select * from (select
|
|
@@ -897,7 +893,7 @@ where REPLACE(REPLACE(title , CHAR(10), ''), CHAR(13), '') is not null and le
|
|
where REPLACE(REPLACE(description, CHAR(10), ''), CHAR(13), '') is not null and length(description)>0
|
|
where REPLACE(REPLACE(description, CHAR(10), ''), CHAR(13), '') is not null and length(description)>0
|
|
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} , {int(page_size / 2)}) as a
|
|
union all
|
|
union all
|
|
select * from (select
|
|
select * from (select
|
|
row_number () over() as id,
|
|
row_number () over() as id,
|
|
@@ -925,7 +921,7 @@ select * from (select
|
|
where REPLACE(REPLACE(title, CHAR(10), ''), CHAR(13), '') is not null and length(title)>0
|
|
where REPLACE(REPLACE(title, CHAR(10), ''), CHAR(13), '') is not null and length(title)>0
|
|
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} , {int(page_size / 2)}
|
|
) as b
|
|
) as b
|
|
|
|
|
|
{op_order}
|
|
{op_order}
|