s4

changeset 297:8933d3701c00

Newer edited group has more precedence of sorting in group list.
author HIROSE Yuuji <yuuji@gentei.org>
date Sat, 24 Sep 2016 13:56:15 +0859
parents da0a9c2380c1
children ec267a1d27ee
files s4-funcs.sh
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line diff
     1.1 --- a/s4-funcs.sh	Sat Sep 24 10:59:51 2016 +0859
     1.2 +++ b/s4-funcs.sh	Sat Sep 24 13:56:15 2016 +0859
     1.3 @@ -1741,10 +1741,13 @@
     1.4  	from $tbl a left join
     1.5  		(select $nm as name,
     1.6  			max(case key when 'gecos' then val end) as gecos,
     1.7 -			max(case key when 'tag' then val end) as tag
     1.8 +			max(case key when 'tag' then val end) as tag,
     1.9 +			max(case key when 'mtime' then val end) as mtime
    1.10  			from ${tbl}_s group by $nm)
    1.11  		b on a.$nm=b.name $cond $3
    1.12 -	order by b.tag desc, a.rowid asc"
    1.13 +	order by b.tag desc, b.mtime desc, a.rowid asc"
    1.14 +  # Give precedence to newer maintained groups (2016-09-24)
    1.15 +  # Note that mtime is stored only in grp_s.
    1.16  err LE:sql.1="$sql"
    1.17    total=`query "with x as ($sql) select count(*) from x;"`
    1.18    echo "${entity} 一覧" | html h2