Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use CMS Sum / Cumulative label

2025-02-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains the "how to use CMS summation / accumulation tag", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "how to use CMS summation / accumulation tag" it!

I. function

Used to query the cumulative sum of certain fields of a table and a condition.

II. Grammar

{sum sum= summation field name action= label type.}

III. Introduction of parameters

Tag type supports: 'sql',' module', 'member',' form', 'mform',' comment', 'table',' tag', 'related'

The syntax of the above tags is supported as data statistical parameters.

For example, for our commonly used module tag, the sum of the hits fields used to query all the data of the news module is as follows:

{module module=news}

Then, change it to a data volume query, which is written as follows:

{sum sum=hits action=module module=news} {$debug_sum}

IV. Relevant examples

1. For example, the sum of the id=222 fields of the id=222 data in the column of the query hits module

{sum sum=hits action=module module=news catid=222} {$debug_sum}

2. Inquire about the total balance of all members

{sum sum=money action=member} {$debug_sum}

3. Customize the data volume query of sql

{sum sum=money action=sql sql='select * from dr_member'} {$debug_sum}

4. Query the amount of data in any table

{sum sum=money action=table table=member} {$debug_sum}

Fifth, the writing of directly returned variables without direct output

For example, when you need to reuse these statistics in a template, you only need to assign a variable, such as the person in the example above.

Direct output: {sum sum=money action=member} {$debug_sum} variable output: {sum sum=money action=member return=mmm} {$mmm_sum} {$debug_sum} where {$mmm_sum} is the current statistical variable, which can be judged, calculated and other operations. thank you for reading. This is the content of "how to use CMS Sum / Cumulative Operation tag". After the study of this article, I believe that you have a deeper understanding of how to use the CMS summation / accumulation tag, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report