Development encountered 650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/ Zh-cn/images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "spacer.gif"/> A page of shops, need to follow the "Sales ranking VIP ranking All stores "Such screening, in fact, without JS and jq These methods can be simple to achieve the point that the corresponding store information!"
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M02/96/7B/wKiom1kibsaB2F6qAAAI1DohUcU776.png-wh_500x0-wm_ 3-wmp_4-s_3405825677.png "Title=" hee hee. png "alt=" wkiom1kibsab2f6qaaai1dohucu776.png-wh_50 "/>
You can pass the parameters to the front page through the background method, and execute the variable settings in the front page URL!
Background method:
Public function getsellerlist ($flag = 0) { $page = ireq::get (' Page ') ? ifilter::act (ireq::get (' page '), ' int ') : 1; $query = New iquery (' seller '); //all Shops if ($flag == 0) { $query->where = ' Is_del = 0 and is_lock = 0 '; $query->order = ' SORT ASC '; //Sales Ranking }else if ($flag == 1) { $query->where = ' is_del = 0 and is_lock = 0 '; $query->order = ' Sale desc '; }  //VIP Shop else if ($flag == 2) { $query- >where = ' Is_Del = 0 and is_lock = 0 and is_vip = 1 '; } $query->page = $page; return $query;}
Front-end Code collation:
Note $flag This parameter is obtained! Because I am the flag obtained through the Iwebshop Framework API interface method, the actual $flag is obtained in the backstage Method!
<div class= "Stores_sort" > <div class= "stores_sort_t" > <a href= "{url:/site/seller/flag/0}" {if: $flag ==0}class= "On" {/if}> all stores </a> <a href= "{URL:/SITE/SELLER/FLAG/1}" {if: $flag ==1}class= "On" {/if}> sales ranking </a> <a href= "{URL:/SITE/SELLER/FLAG/2}" {if: $flag ==2}class= "on" {/IF}>VIP store <span> </span></a> </div></div>
This article from "Kangjunfei" blog, declined reprint!
Example of URL passing MySQL return method