|
|
|
@ -28,13 +28,41 @@ FROM whatsapp_session
|
|
|
|
|
WHERE coli_sn = 0 AND last_received_time IS NOT NULL ## AND opi_sn = 599
|
|
|
|
|
ORDER BY last_received_time DESC
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查找 WA 号码不一致
|
|
|
|
|
SELECT *
|
|
|
|
|
FROM whatsapp_session
|
|
|
|
|
WHERE whatsapp_phone_number_bak IS not NULL
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ---------------------------------------------------------
|
|
|
|
|
* 分配会话到某个订单
|
|
|
|
|
*/
|
|
|
|
|
UPDATE whatsapp_session
|
|
|
|
|
SET coli_sn = 1074885
|
|
|
|
|
WHERE sn = 47
|
|
|
|
|
AND msg.froms = @S_WAID;
|
|
|
|
|
|
|
|
|
|
UPDATE whatsapp_inboundmessage msg
|
|
|
|
|
INNER JOIN whatsapp_session s ON s.whatsapp_phone_number = msg.froms
|
|
|
|
|
AND msg.msg_direction = 'inbound'
|
|
|
|
|
SET msg.coli_sn = s.coli_sn
|
|
|
|
|
WHERE ifnull(msg.coli_sn, 0) = 0
|
|
|
|
|
AND msg.msg_direction = 'inbound'
|
|
|
|
|
AND msg.froms = '393343998897';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UPDATE whatsapp_inboundmessage msg
|
|
|
|
|
INNER JOIN whatsapp_session s ON s.whatsapp_phone_number = msg.tos
|
|
|
|
|
AND msg.msg_direction = 'outbound'
|
|
|
|
|
SET msg.coli_sn = s.coli_sn
|
|
|
|
|
WHERE ifnull(msg.coli_sn, 0) = 0
|
|
|
|
|
AND msg.msg_direction = 'outbound'
|
|
|
|
|
AND msg.tos = '393343998897';
|
|
|
|
|
/**
|
|
|
|
|
* end 分配会话到某个订单
|
|
|
|
|
* ---------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ---------------------------------------------------------
|
|
|
|
|
* 未分配会话 - 处理
|
|
|
|
|