1

我正在创建一个显示属性的房地产网站。在每个房产列表上,我想要一个显示“表达兴趣”的按钮,当单击此按钮时,应向我发送一封电子邮件,其中包含表达兴趣的用户详细信息(用户将登录,因此他们的所有详细信息将来自他们的帐户)。

我的电子邮件功能工作正常,但是,我还想显示有“表达兴趣”的人数。有没有办法跟踪使用此按钮发送电子邮件的次数并显示“xx 人已表示对此属性感兴趣”

4

2 回答 2

1

Store in the database before sending the mail and just before sending the mail include the number of people or the people who are interested, a simple query would suffice, or if you have a content management system you can include it there, in both cases you would need an intermediate table (connection between user id and real-estate id)

于 2012-10-16T12:09:46.933 回答
0

我会在您的数据库中添加另一个表来存储 property_id 和 user_id。如果用户单击表示感兴趣,则使用当前 property_id 和当前 user_id 向该表添加另一行。要获得链接的数量,您只需计算行数

SELECT count(user_id) FROM interest_relation WHERE property_id = 'your property id'

通过这种方式,您还可以找出哪个用户对哪个属性感兴趣。

于 2012-10-16T12:16:27.630 回答