- 获取顶级栏目下是否3级,并输出指定的字符
- 模板使用方法:{$field.typeid|diy_arctype_level=###,输出的字符}
*/
function diy_arctype_level($typeid, $str = '')
{
$result = model('Arctype')->getHasChildren($typeid, true);
$max_level = 0;
$temp = [];
foreach ($result as $k => $v){
$temp[] = $v['level'];
}
!empty($temp) && $max_level= max($temp);
相关文章