The first, directly write the sub-column ID, with Cat in
{pc:get sql= "select * from V9_news where status=99 and CatID in (21,22,23,24,25) Order by ID DESC" num= "7" return= "Data"}
{Loop $data $r}
<li><a href= "{$r [url]}" title= "{$r [title]}" target= "_blank" >{str_cut ($r [' title '],40)} ({date (' m-d ')} ({"", $r [ Inputtime]) </span></a></li>
{/loop}
{/PC}
The benefits of this approach: You can customize the column you want to take
Disadvantage: To write more than one ID, the background added to the column, the ID will be written in
The second, according to the parent column ID, such as the above 21,22,23,24,25 are 15 below the sub-column, you can write:
{loop subcat ($k) $v}
{php $subcatid [] = $k;}
{/loop}
{php $subcatid = implode (', ', $subcatid);}
{pc:get sql= "select * from V9_news where status=99 and CatID in ($subcatid) Order by ID DESC" num= "7" return= "Data"}
{Loop $data $r}
<li><span><strong><a href= "{$CATEGORYS [$r [Catid]][url]}" >[{$CATEGORYS [$r [catid]][ Catname]}]</a><a href= "{$r [url]}" title= "{$r [title]}" target= "_blank" >{str_cut ($r [' title '],40)}</a ></strong><em>[{date (' y-m-d ', $r [inputtime])}]</em></span></li>
{/loop}
{/PC}
Benefits: Just write a parent column ID, automatically take the subordinate sub-column ID
Disadvantage: The circular parent column under all the sub-column ID, if the content of a sub-column does not want to display, not good implementation
Both methods have pros and cons, depending on the circumstances of the election.
Two methods for Phpcms V9 to call the column sub-column