Home  >  Q&A  >  body text

ajax - thinkphp多条件筛选功能疑问?

请问类似淘宝这种多条件筛选功能怎么组合筛选?我现在实现了大红框里面点击条件组合筛选的功能,但是输入框和里面的价格条件怎么和外面的条件去组合呢? 比如我要筛选 500-1000 价格范围内的女款电子表,求思路。谢谢

phpcn_u1582phpcn_u15822736 days ago646

reply all(4)I'll reply

  • ringa_lee

    ringa_lee2017-05-16 13:15:41

    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.

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-16 13:15:41

    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.

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-16 13:15:41

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

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-16 13:15:41

    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.

    reply
    0
  • Cancelreply