For example, if I want products with prices in the price range of 20-3050-6070-80, the relationship is or, and the title should contain skirts, jackets, and coats, and the relationship between the subject and children's clothes, books, and the relationship is or, how should I write such a statement? How should I design Php statements that are expressed as variables... for example, if I want a product with a price range of 20-30 50-60 70-80, the relation is or.
At the same time, the title should contain a skirt, coat, or coat,
We also want to exclude titles including children's clothing, books, and relationships as and. How should we write such statements? How should we design Php If Php is expressed as a variable? I am using thinkphp. Can I use thinkphp to encapsulate addition, deletion, modification, and query operations?
Reply content:
For example, if I want a product with a price range of 20-30 50-60 70-80, the relation is or.
At the same time, the title should contain a skirt, coat, or coat,
We also want to exclude titles including children's clothing, books, and relationships as and. How should we write such statements? How should we design Php If Php is expressed as a variable? I am using thinkphp. Can I use thinkphp to encapsulate addition, deletion, modification, and query operations?
Where (price> 20 and price <30) or (price> 50 and price <60) or (price> 70 and price <80 )) and (title like ....) or ......)
You can write it like this, but if your data volume is a little bit larger, it can easily cause serious performance problems.
You should use elasticsearch, sphtracing, xunsearch, solr, and other search engines to solve this problem.