To add a corresponding openid to the employee table, how to associate it? Do you need to follow it after creating a new employee? Or what?
Reply content:The way you asked is that there is already an employee table. Two situations.
The employee has registered, let the employee log in, and update the employee's openid.
Employees are not registered, please register and bring openid.
Do you have any questions? Or am I not understanding the question clearly?
Is creating a new employee similar to self-registration?
If so, then you can get the open_id by logging in to WeChat before registration (scan QR code on PC, authorized login in WeChat), then fill in the new employee form, and then insert openid and employee data into the employee table
It is recommended to have an employee table and a following table, and use the backend to manage the relationship between employees and following users, which is to manually set which following user is an employee of which company.
From what you mean, there is already an employee table before. But now that WeChat is connected, WeChat users need to be associated with the previous employee table. To associate user tables generated by two different systems, you first need to have a unified and unique association identifier, such as a mobile phone number. For example, in the previous employee table, each employee filled in a mobile phone number. Then after the user follows the WeChat official account, the user is forced to bind the mobile phone number first. At this time, go to the employee table to query. If the mobile phone number already exists, then bind the employee to the openid. If it does not exist, write the employee directly. Table
WeChat users can get openid by sending messages to the official account or following it
To determine whether an employee is following or not,
If the employee is following, use the plug-in to update the employee's openid,
If the employee is not following, bind the openid when following