ajax - Thinkphp multi-condition filtering function question?
phpcn_u1582
phpcn_u1582 2017-05-16 13:13:41
0
4
696

< /p>

How do you combine multiple filtering functions like Taobao? I have now implemented the function of combining and filtering by clicking on conditions in the big red box, but how do I combine the input box and the price conditions inside with the conditions outside? For example, I want to filter women’s electronic watches in the price range of 500-1000, and I’m looking for ideas. Thank you

phpcn_u1582
phpcn_u1582

reply all(4)
左手右手慢动作

Your question is whether the front-end is implemented or the server is implemented. I guess it is the front-end implementation.

Then this query condition can be used to filter table data directly using get 方式,比如用户点击 手表JavaScript 中监听所有类别的点击事件,然后在当前 url followed by the corresponding field name and field value of watch to jump.

Similarly for the price, the operation logic when clicking the OK button is the same as clicking the Watch.

Taobao does not combine various filtering conditions at once and then query. Instead, click on a certain filtering condition to perform a filter refresh.

曾经蜡笔没有小新

Generally, parameters are passed through get method for filtering. After entering the price, there should be a confirm button. When clicking the confirm button, use js to get the current link, and then assemble the price link to jump.

我想大声告诉你

Use sql to combine where conditions to query the database, and then return the queried data to the front end

世界只因有你

Your question is a bit strange. There is essentially no difference between clicking and typing. They are both part of the form.
As for how to check the database, you need to formulate sql according to your table structure.
However, to achieve this function, you generally need to use a search engine. It is not very good to directly check the database, and it is too stressful.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template