These days I am working on a secondary development of a logistics system, mainly in template design. Next we will introduce the background of this application: We have a new channel model, in which a field is the regional association form in dede ?? Nativeplace. If a customer comes in, a large amount of information will be found, and the customer is most concerned with the target information around him. Therefore, the second development of a logistics system over the past few days is mainly the template design. Next we will introduce the background of this application: We have a new channel model, in which a field is the regional association form in dede ?? Nativeplace. If a customer comes in, a large amount of information will be found, and the customer is most concerned with the target information around him. Therefore, you want to filter the classification information by Region selection.
Shows the effect. the following code is provided. First, add the following content to the corresponding List template to generate the filter options on top of the graph:
{Dede: infoguide} {/dede: infoguide}
Next I will only talk about the implementation of regional Filtering. please add others. Find/plus/list. php: $ t1 = ExecTime (); change to the above code
The key here is to define a $MysqlVariables are better than SQL statements used for filtering.
Next, find $ lv = new ListView ($ tid); change to $ lv = newListView ($ tid, $ mySql );.
Find include/arc. listview. class. php at: var $ remoteDir; and add: var $ mySql;
Change the following // php5 constructor to function _ construct ($ typeid, $ mySql, $ uppage = 1 );
Next, add a line after: global $ dsql, $ ftp;: $ this-> mySql = $ mySql;
Next, there is an official comment in this file.: // In normal cases, first identify the ID from the arctiny table, and then query by ID (fast. There are two else. we want to change the query in the second else. That is, the first $ t2 = ExecTime (); Query in the previous else in the entire file. change the part after its where to wherearc. id in ($ idstr) $ mySql $ ordersql ";
So far, our classification information filtering can be used.
GET as $ k => $ v) {if ($ k = 'nativeplace') {$ mySql = $ mySql. and '. $ k. "= '". $ v. "'";}}
The key here is to define a $ mysql variable, which is better than organizing SQL statements for filtering.
Next, find $ lv = new ListView ($ tid); change to $ lv = newListView ($ tid, $ mySql );.
Find include/arc. listview. class. php at: var $ remoteDir; and add: var $ mySql;
Change the following // php5 constructor to function _ construct ($ typeid, $ mySql, $ uppage = 1 );
Next, add a line after: global $ dsql, $ ftp;: $ this-> mySql = $ mySql;
Next, there is an official note in this file: // in normal cases, first identify the ID from the arctiny table, and then query by ID (the speed is very fast) to find it here. There are two else. we want to change the query in the second else. That is, the first $ t2 = ExecTime (); Query in the previous else in the entire file. change the part after its where to wherearc. id in ($ idstr) $ mySql $ ordersql ";
So far, our classification information filtering can be used.