select from_unixtime(m.createdAt, ‘%Y-%m-%d %H:%i:%s‘) from kfrobotaidlog m;
select m.customeruid, from_unixtime(m.createtime, ‘%Y-%m-%d %H:%i:%s‘) as `date-time`, m.kfuid, case when m.kfuid = 1001 then ‘自动回答‘ when type = 2 then ‘人工回答‘ else ‘客户问题‘ end as `问答`, m.content as `内容` from kfmessage m join (select distinct customeruid from kfmessage where kfuid = 1001 and
m2 on m.customeruid = m2.customeruid where m.createtime > UNIX_TIMESTAMP(STR_TO_DATE(‘2019-01-20 00:00:00‘, ‘%Y-%m-%d %H:%i:%s‘)) and m.createtime < UNIX_TIMESTAMP(STR_TO_DATE(‘2019-01-20 10:00:00‘, ‘%Y-%m-%d %H:%i:%s‘)) and m.kfuid <> 1002 order by m.customeruid, id