All the fields selected by thinkphp text are in the same table.

Source: Internet
Author: User
The thinkphp text filtering fields are all in the program code public & nbsp; function & nbsp; index () {$ Data & nbsp; M (zhaopin); & nbsp; & nbsp; instantiate the Data object import (ORG. util. page); & nbsp; import pagination class $ count & nbsp thinkphp text filter fields are all in a table




Program code

Public function index (){
$ Data = M ('zhaopin'); // instantiate a Data object
Import ('org. Util. page'); // import the paging class
$ Count = $ Data-> where ($ map)-> count (); // query the total number of records meeting the requirements
$ Page = new Page ($ count, 20); // The total number of incoming records in the instantiated Page class
$ NowPage = isset ($ _ GET ['P'])? $ _ GET ['P']: 1;
$ List = $ Data-> where ($ map)-> order ('shijian desc, id asc ')-> page ($ nowPage. ','. $ Page-> listRows)-> select ();
$ Show = $ Page-> show (); // display the output by Page
$ This-> assign ('count', $ count );
$ This-> assign ('page', $ show); // value-assigned paging output
$ This-> assign ('list', $ list); // assign a value to a dataset
$ This-> display (); // output Template
}


Filtering area

Recruitment position:

All

{$ Vo ['position']}

Region:

All Shenzhen

{$ Vo ['recruitment ']}



Content code


{$ Vo ['job'] | mb_substr = 0, 8, 'utf-8 '}
{$ Vo ['company _ name']}
{$ Vo ['recruitment ']}
{$ Vo ['shijian ']}
Recruitment: {$ vo ['hiring ']}
Company Nature: {$ vo ['natural']}
Scale: {$ vo ['company _ scale']} people
Experience: {$ vo ['work _ experience ']} years
Education Degree: {$ vo ['gree _ required']}
Monthly salary: {$ vo ['salary ']} RMB/month
Job requirements: {$ vo ['job _ requirements '] | mb_substr = 0,150, 'utf-8 '}
View position


------ Solution ----------------------

Public function index (){
$ Data = M ('zhaopin'); // instantiate a Data object
Import ('org. Util. page'); // import the paging class

$ Map = "1 = 1"; // initialize a condition variable
$ Position = $ this-> _ param ('position'); // receives the parameter
$ Recruitment = $ this-> _ param ('recruitment '); // receives parameters
If ($ Position <> ''){
$ Map. = "and Position = '$ position '";
}
If ($ Recruitment <> ''){
$ Map. = "and Recruitment = '$ Recruitment '";
}

$ Count = $ Data-> where ($ map)-> count (); // query the total number of records meeting the requirements
$ Page = new Page ($ count, 20); // The total number of incoming records in the instantiated Page class
$ NowPage = isset ($ _ GET ['P'])? $ _ GET ['P']: 1;
$ List = $ Data-> where ($ map)-> order ('shijian desc, id asc ')-> page ($ nowPage. ','. $ Page-> listRows)-> select ();
$ Show = $ Page-> show (); // display the output by Page
$ This-> assign ('count', $ count );
$ This-> assign ('page', $ show); // value-assigned paging output
$ This-> assign ('list', $ list); // assign a value to a dataset
$ This-> display (); // output Template
}

This is probably the case. let's see if it works.

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.