我想加入 2 张 table 的 Grocery 店。 子表有2个或更多匹配值
--store_specs--
|id | label |value |store_id|
+---+---------+---------+--------+
|3 |Height |20 CM |2 |
|4 |Weight |50 Grams |2 |
--store_items--
|id |title |description |stock |category_id |images|
+----------+---------------+-------------------+---------------+---------------+------+
|2 |Tweezers... |Super high... |5 |1 | |
|3 |Soldering... |Lorem Ipsum... |12 |1 | |
|4 |aaa |bvbbb |2 |2 | |
它会像这样显示 在 Grocery 原油
|id |title |description |specs |
+----------+---------------+-------------------+----------------------------+
|2 |Tweezers... |Super high... |Height: 20cm, Weight:50Grams|
|3 |Soldering... |Lorem Ipsum... | |
|4 |aaa |bvbbb | |
请大家帮帮我,谢谢。
最佳答案
当前版本不支持,但您可以使用自定义模型,请参阅下面的线程。
关于mysql - Grocery 店 Crud 连接 2 张 table ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27526965/