Qq consultation on how to use a balanced distribution to customer service-php Tutorial

Source: Internet
Author: User
Qq consulting how to use a balanced distribution to customer service now many web pages use qq Consulting, users click qq consulting can communicate with customer service qq. The front-end code is as follows: & lt; a & nbsp; target_blank & nbsp; hrefwpa. qq. commsgrd? V3 & amp; uin652193863 & amp; siteqq & amp; me qq
Qq consulting is now used on many Web pages. Users can click qq consulting to communicate with customer service on qq.
The front-end code is as follows:
 


If there are multiple qq customer service, but I don't want to list all qq, I want to list only one qq. when a user clicks, the user will be evenly allocated to customer service. for example, there are five customer service personnel, when the website has 100 people for consultation, each customer service can receive about 20 consultations on average. How can this problem be achieved?

--------------------------------------
I have posted several forum posts before, but they said that the front-end cannot be completed and the background should be used together. Ask experts to teach me.
------ Solution ----------------------
Create a table in the database with the 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 first unused qq.
Then
Update qq set status = 1 where id = xxx; xxx is the qq id just extracted

Then Judge
Select count (*) from qq where status = 0
Check whether there are any unshown ones. If yes, it will not be processed.
If no
Update qq set status = 0; batch restore.

In this way, the distribution can be averaged.

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.