Home  >  Article  >  Backend Development  >  qq咨询如何用均衡分配给客服

qq咨询如何用均衡分配给客服

WBOY
WBOYOriginal
2016-06-13 12:19:41955browse

qq咨询怎么用均衡分配给客服
现在很多网页中都使用了qq咨询,用户点击qq咨询就可以和客服进行qq交流。
前端代码如下:

<a class="qqOn" target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=652193863&site=qq&menu=yes"><img  border="0" src="http://wpa.qq.com/pa?p=2:652193863:41 &r=0.8940031429092906" alt="qq咨询如何用均衡分配给客服" ></a>


如果有多个qq客服,但我不想把所有qq都列出来,我想只列出一个qq,当用户点击时会均衡分配给客服,比如有5个客服,当网站有100个人咨询时,平均每个客服能收到20个左右的咨询。 请问怎么实现?

——————————————————————————————————————
之前发过几个版块,但他们说前端无法完成,要后台配合。请高手们教我。
------解决思路----------------------
在数据库中建立一张表,表名qq
结构如下
id, qq,        status
1   11111     0
2   22222     0
3   33333     0

当用户访问时。
select qq from qq where status=0 order by id asc limit 1
选出最前的一个未使用过的qq。
然后
update qq set status=1 where id=xxx;  xxx 为刚才抽出的qq id

然后判断
select count(*) from qq where status=0
看看是否还有未显示过的。如果有则不处理。
如果没有了,则
update qq set status=0; 批量还原。

这样就能平均分配了。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn