{fzw:for:sql="select *,(select count(id) from sl_history as h where h.leixing='关注' and h.laiyuanbianhao=u.id) as guanzhushu,(select count(id) from sl_history as h where h.leixing='视频学习' and h.yonghuming=u.yonghuming) as kechengshu from sl_user as u where u.id={fzw:url:id/}" id="p1"}

{if value1="{fzw:p1:nicheng/}" value2="" bi="=="}{fzw:p1:yonghuming/}{else}{fzw:p1:nicheng/}{/if}

{fzw:p1:zuoyouming/}

年龄:{fzw:p1:shengri datetime="yyyy"/}课程数:{fzw:p1:kechengshu/}关注:{fzw:p1:guanzhushu/}人 {if value1="{fzw:for:sql="select count(id) as shu from sl_history where laiyuanbianhao={fzw:p1:id/} and leixing='关注' and yonghuming='{fzw:cookie:name="user_name"/}'" id="p2"}{fzw:p2:shu/}{/fzw:for:sql}" value2="0" bi="=="} 关注TA {else} 已关注 {/if} 私聊TA

{/fzw:for:sql}