Example of URL passing MySQL return method

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.