QQ Consulting How to use a balanced distribution to customer service

Source: Internet
Author: User
QQ Consulting How to use a balanced distribution to customer service
Now a lot of web pages are used QQ Consulting, users click on QQ Consulting can and customer service QQ communication.
The front-end code is as follows:
 


If there are many QQ customer service, but I do not want to put all the QQ list, I would like to list only one QQ, when the user clicks will be evenly distributed to customer service, for example, there are 5 customer service, when the site has 100 people consultation, the average customer service can receive 20 or so consultation. How to achieve it?

——————————————————————————————————————
A few previous sections, but they said the front end can not be completed, to the background to cooperate. Please teach me the master.
------to solve the idea----------------------
Create a table in the database, table name QQ
The structure is as follows
ID, QQ, status
1 11111 0
2 22222 0
3 33333 0

When the user accesses.
Select QQ from QQ where status=0 ORDER by ID ASC Limit 1
Select the last unused QQ.
And then
Update QQ set Status=1 where id=xxx; XXX for the QQ ID just pulled out

Then judge
Select COUNT (*) from QQ where status=0
See if there are any that haven't been shown yet. If any, it is not processed.
If it is not, then
Update QQ set status=0; Bulk restore.

This will be evenly distributed.
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.