本文介绍了用户推荐系统使用php,mysql?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我已经有一个完全认可的会员制,想要整合我自己的用户推荐系统,但想要一些技巧,建议真的在做。 我目前的注册用户表格类似于 我有一些其他字段,但与我想要做的事情无关,并保持简单我尽可能把他们留下来 我正在考虑创建一个名为 referrals 的新表,例如当一个注册用户我的网站来自用户表是指某人(我想我会创建一个表单,要求他们想要参考的人的电子邮件和他们的名字,并将其添加到引荐表),然后显示在那里帐户谁参考和他们提到的人数以及他们所提到的人是否加入了我的网站。 我希望如果有人可能会解释我所需要的逻辑转介表追踪转介? 我的表格如下所示:显然在注册页面上我会有一个引荐来源文本框,用户可以输入被引用的用户名,检查是否已被注册的成员转介,我猜在推荐电子邮件链接中,我会添加提交转介的用户,并在注册页面上进行简单的检查,如注册?ref = username_here ,如果引用通过获取将用户名自动添加到文本框中。 正如你所看到的,我正在努力处理引荐表的逻辑如果有人可以解释我还需要什么,那么会喜欢吗?和逻辑背后我将需要做的在PHP中把它全部在一起(而不是代码)只是一个快速粗略的指导我应该做什么。我知道我需要做一些检查,例如检查以确保他们以前没有提及过(因为垃圾邮件的原因),并且他们想要引用的人的电子邮件以前没有被其他人引用(出于垃圾邮件的原因),而且他们想要引用的人的电子邮件不会作为用户表中已注册的成员等。 也许我比现在更难,但我是由于某种原因没有得到它背后的逻辑,如果有人可以告诉我,如果我在做什么是完全错误的,而不是最好的方法,请做。 我想你可以说我要求一个转介表的模型(草案)来做我想要的事情,我应该在php中做的一切,把它们整合在一起。 感谢任何帮助,提示,建议和抱歉,如果我长时间或困惑每个人。解决方案设置推荐表如下: referrals: id(主键) referrer_id (正在引用别人的用户) refer_email(被引用的人的电子邮件)状态(引用[默认],注册) created_on updated_at 遵循不信任任何人的政策,您不应该在名称中使用名称作为字段。例如。我发送转介:email => your_email,name => 滥用。它会降低你的价值。 的引荐: select count(*)as referral_count from referrals where referrer_id ='user_id' I already have a fully pledged membership system and want to integrate my own user referral system but want some tips, advice really on doing it.My current registered users table is something likeI have some other fields but not relevant to what I want to do and to keep things as simple as possible I left them outI am thinking of creating a new table called referrals and for example when a registered user on my site from users table refers someone (I guess I would create a form that asks for email of person they want to refer and their name and add that to referrals table) it then displays in there account who they referred and how many people they referred and if the person they referred joined up to my site.I am hoping if someone could possibly explain the logic of what I need in my referrals table to track the referrals?my table so far looks like this:obviously on signup page I would have a referrer text box that user can enter persons username they was referred by and checks to see if they was referred by the already registered member and i guess in a referral email link i would add user who made referral and do a simple check on signup page something like signup?ref=username_hereand if ref isset via get add the username automatically into text box.As you can see i am struggling with the logic behind the referrals table and would love it if someone could explain what else i would need ? and logic behind what I would need to be doing in php to bring it all together (not code) just a quick rough guide on what I should be doing. I know I would need to do certain checkes etc like check to ensure they have not referred them previously (for spam reasons) and that the email of person they want to refer has not been referred by someone else previously (for spam reasons) and that the email of person they want to refer does not exists as an already registered member in users table etc.Maybe am I making this harder than what it actually is but I am for some reason not getting the logic behind it al, if someone could tell me if what I'm doing is totally wrong and not the best way to go about it please do.I guess you could say i am asking for a mockup (draft) of a referrals table to do what i want and the sort of things i should be doing in php to bring it all together.Thanks for any help, tips, advice and sorry if I went on to long or have confused everyone. 解决方案 Set the referral table as follows:referrals: id (primary key) referrer_id (user who is referring someone else) referred_email (email of person being referred) status (referred[default], registered) created_on updated_atFollowing the policy "do not trust anybody" you should not use name as a field in referrals. Eg. I send a referral: email=>your_email, name=>abuse. It demotes you.For counting no. of referrals:select count(*) as referral_count from referrals where referrer_id = 'user_id' 这篇关于用户推荐系统使用php,mysql?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-27 14:19