This article describes how to use destoon to display the number of supply, enterprise, and information items on the homepage. it is very useful in template development, if you need it, you can refer to destoon to display the number of supply, enterprise, and information items on the homepage. here we will introduce how to directly call the php program code for query. The destoon template supports php code, so we can query it directly in the template.
The implementation code is as follows:
{Php $ sellcount = $ db-> get_one ("select count (*) AS num FROM". $ DT_PRE. "explain WHERE status = 3 ");}
- Total {$ sellcount [num]} supplies
{Php $ company = $ db-> get_one ("select count (*) AS num FROM". $ DT_PRE. "member WHERE groupid> 5 ");}
- A total of {$ company [num]} enterprises
{Php $ newcount = $ db-> get_one ("select count (*) AS num FROM". $ DT_PRE. "article_21 WHERE status = 3 ");}
- Total {$ newcount [num]} pieces of information
How to display the current date on the page:
{Date ('Y-m-D', $ DT_TIME )}