看起来您没有记录用户喜欢或不喜欢页面的数量。在这种情况下,LIKES应该是一个多表,并且应该有另一个名为 APPS(或您希望的任何名称)的表来存储页面:
**USER**
+---------+-------+-----+
| user_id | name | ....|
+---------+-------+-----+
| 1 | ... | ... |
+---------+-------+-----+
| 2 | ... | ... |
+---------+-------+-----+
**APPS**
+---------+-------+-----+
| app_id | name | ....|
+---------+-------+-----+
| 1 | ... | ... |
+---------+-------+-----+
| 2 | ... | ... |
+---------+-------+-----+
**LIKES**
+---------+-------+----------+----------+
| like_id |user_id| app_id | is_liked |
+---------+-------+----------+----------+
| 1 | 1 | 2 | 1 |
+---------+-------+----------+----------+
| 2 | 1 | 3 | 0 |
+---------+-------+----------+----------+
如果用户点击喜欢( is_liked = 1)
或不喜欢( is_liked = 0)
页面,您可以在哪里切换