{eyou:assign name="typeid" value="$eyou.field.typeid"}
{eyou:sql sql='SELECT count(aid) AS count FROM ey_archives WHERE restric_type= 2 AND typeid=$typeid' cachetime='-1'}{$field.count}{/eyou:sql}
当前栏目下的子栏目数量
{eyou:assign name="typeid" value="$eyou.field.typeid"}//栏目页显示数量,列表显示的话改$field.typeid
{eyou:sql sql='Select count(*) as AllNum from ey_arctype where parent_id = $typeid AND is_del = 0 AND status = 1' cachetime='-1'}
{$field.AllNum}
{/eyou:sql}
设计师与其作品关联列表
{eyou:assign name='writer' value='$eyou.field.author'/}
<!-- 获取作者名称变量 -->
{eyou:sql sql='SELECT aid,author,litpic FROM ey_archives WHERE
author = "$writer" AND typeid="345" limit 10' cachetime='-1'}
{eyou:arcview aid="$field.aid" id="field2"}
<li><a href="{$field2.arcurl}"><img src="{$field2.litpic}">{$field2.title}</a></li>
{/eyou:arcview}
{/eyou:sql}
点赞插件内容页统计数量
{eyou:assign name="aid" value="$eyou.field.aid"}
{eyou:sql sql='Select count(*) as AllNum from ey_weapp_zan where aid = $aid' cachetime='-1'}
{$field.AllNum}
{/eyou:sql}
易优cms统计某文章的下载数量
{eyou:assign name="aid" value="$eyou.field.aid"}
{eyou:sql sql='Select count(*) as AllNum from ey_download_log where aid = $aid' cachetime='-1'}
{$field.AllNum}
{/eyou:sql}
易优cms统计搜索结果页关键词文章数量
{eyou:assign name="keywords" value="$eyou.field.keywords"}
<!--通过自定义变量assign获取关健词-->
{eyou:sql sql='Select count(*) as AllNum from ey_archives where title like "%$keywords%" AND is_del = 0' cachetime='-1'}
{$field.AllNum}
<!--返回查询数量为allNum字段-->
{/eyou:sql}
易优会员购买产品列表显示
{eyou:sql sql='SELECT ul.product_name,um.order_amount,um.add_time,u.nickname,u.head_pic FROM ey_shop_order AS um LEFT JOIN ey_users AS u on um.users_id = u.users_id LEFT JOIN ey_shop_order_details AS ul on ul.order_id = um.order_id WHERE um.order_status = 3 ORDER BY um.moneyid DESC LIMIT 0,10' cachetime='-1'}
<li>
<img src="{$field.head_pic}">
<a><strong>{$field.nickname}</strong><em>¥{$field.order_amount}</em>购买了<span>{$field.product_name}</span><i>[{$field.add_time|MyDate='Y-m-d H:i:s',###}]</i></a>
</li>
{/eyou:sql}
产品近6个月添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM ey_archives WHERE status = 1 AND FROM_UNIXTIME(ADD_TIME) BETWEEN DATE_SUB(now(),INTERVAL 6 month) and now() AND channel = 2' cachetime='-1'}{$field.count}{/eyou:sql}
文章近6个月添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM ey_archives WHERE status = 1 AND FROM_UNIXTIME(ADD_TIME) BETWEEN DATE_SUB(now(),INTERVAL 6 month) and now() AND channel = 1' cachetime='-1'}{$field.count}{/eyou:sql}
产品上周添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM ey_archives WHERE status = 1 AND YEARWEEK(date_format(FROM_UNIXTIME(ADD_TIME),"%Y-%m-%d")) = YEARWEEK(now())-1 AND channel = 2' cachetime='-1'}{$field.count}{/eyou:sql}
文章上周添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM ey_archives WHERE status = 1 AND YEARWEEK(date_format(FROM_UNIXTIME(ADD_TIME),"%Y-%m-%d")) = YEARWEEK(now())-1 AND channel = 1' cachetime='-1'}{$field.count}{/eyou:sql}
产品本周添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM ey_archives WHERE status = 1 AND YEARWEEK(date_format(FROM_UNIXTIME(ADD_TIME),"%Y-%m-%d")) = YEARWEEK(now()) AND channel = 2' cachetime='-1'}{$field.count}{/eyou:sql}
文章本周添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM ey_archives WHERE status = 1 AND YEARWEEK(date_format(FROM_UNIXTIME(ADD_TIME),"%Y-%m-%d")) = YEARWEEK(now()) AND channel = 1' cachetime='-1'}{$field.count}{/eyou:sql}
产品去年添加数量统计标签
{eyou:sql sql='SELECT count(aid) AS count FROM ey_archives WHERE status = 1 AND YEAR(FROM_UNIXTIME(ADD_TIME))=YEAR(date_sub(now(),INTERVAL 1 YEAR)) AND channel = 2' cachetime='-1'}{$field.count}{/eyou:sql}