升级:
1、生成 pm_plists 表基础数据
- INSERT INTO `pre_ucenter_pm_lists`
- (authorid, pmtype, subject, members, min_max, dateline,lastmessage)
- SELECT * from (SELECT msgfromid as authorid, 1 as pmtype, '' as subject, 2 as members,
- CONCAT(LEAST(msgfromid,msgtoid),'_',GREATEST(msgfromid,msgtoid)) as min_max, dateline,
- CONCAT('a:3:{s:12:"lastauthorid";s:',LENGTH(msgfromid),':"',msgfromid,'";s:10:"lastauthor";s:',LENGTH(msgfrom),'
:"',msgfrom,'";s:11:"lastsummary";s:',LENGTH(message),':"',LEFT(IF(LENGTH(subject) > 0 AND STRCMP(subject, message),
CONCAT(subject, '\r\n', message), message),150),'";}') as lastmessage- FROM `pre_ucenter_pms`
- WHERE related = 1 order by dateline desc) as tmp GROUP BY min_max;