This commit is contained in:
midoks
2023-10-30 14:47:54 +08:00
parent f74702cbad
commit 109f562f06
2 changed files with 26 additions and 9 deletions
+9 -2
View File
@@ -545,10 +545,17 @@ def repoList():
data['root_url'] = getRootUrl()
repo_where1 = ''
repo_where2 = ''
if search != '':
repo_where1 = ' where name like "%' + search + '%"'
repo_where2 = ' where r.name like "%' + search + '%"'
start = (page - 1) * page_size
list_count = pQuery('select count(id) as num from repository')
list_count = pQuery(
'select count(id) as num from repository' + repo_where1)
count = list_count[0]["num"]
sql = 'select r.id,r.owner_id,r.name as repo, u.name from repository r left join user u on r.owner_id=u.id order by r.id desc limit ' + \
sql = 'select r.id,r.owner_id,r.name as repo, u.name from repository r left join user u on r.owner_id=u.id ' + repo_where2 + ' order by r.id desc limit ' + \
str(start) + ',' + str(page_size)
# print(sql)
list_data = pQuery(sql)