在 include\extend.func.php 加个函数
function click_round_number( $number, $min_value = 1000, $decimal = 1 ) { if( $number < $min_value ) { return $number; } $alphabets = array( 100000000 => '亿', 10000 => '万', 1000 => '千' ); foreach( $alphabets as $key => $value ) if( $number >= $key ) { return round( $number / $key, $decimal ) . '' . $value; } }
内容模板中调用标签
{dede:field.click function=click_round_number(@me)/}
这样就能实现dedecms织梦点击数过千过万过亿写法
dedecms织梦点击数过千过万过亿写法
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:https://www.heiqu.com/b6ba24e5ecd069e198278a2dbf16808b.html