作者 邓超

x uuid

@@ -162,6 +162,12 @@ class Home extends Base { @@ -162,6 +162,12 @@ class Home extends Base {
162 ) 162 )
163 ); 163 );
164 164
  165 + // map
  166 + $lists = array_map(function ($v){
  167 + $v['uuid'] = get_email_uuid($v['subject'],$v['udate'],$v['folder_id'],$v['from'],$v['to'],$v['size']);
  168 + return $v;
  169 + },$lists);
  170 +
165 // 总数 171 // 总数
166 $total = db()->count( 172 $total = db()->count(
167 listsSql::listCount(dbWhere($where)) 173 listsSql::listCount(dbWhere($where))
@@ -627,6 +633,9 @@ class Home extends Base { @@ -627,6 +633,9 @@ class Home extends Base {
627 633
628 if($data){ 634 if($data){
629 $sync_num = 0; 635 $sync_num = 0;
  636 +
  637 + $data['uuid'] = get_email_uuid($data['subject'],$data['udate'],$data['folder_id'],$data['from'],$data['to'],$data['size']);
  638 +
630 $data['to_name'] = $data['to_name'] ? json_decode($data['to_name'],true) : []; 639 $data['to_name'] = $data['to_name'] ? json_decode($data['to_name'],true) : [];
631 $data['cc'] = $data['cc'] ? json_decode($data['cc'],true) : []; 640 $data['cc'] = $data['cc'] ? json_decode($data['cc'],true) : [];
632 $data['bcc'] = $data['bcc'] ? json_decode($data['bcc'],true) : []; 641 $data['bcc'] = $data['bcc'] ? json_decode($data['bcc'],true) : [];
@@ -443,3 +443,16 @@ function strip_tags_content($text, $tags = '', $invert = FALSE) { @@ -443,3 +443,16 @@ function strip_tags_content($text, $tags = '', $invert = FALSE) {
443 } 443 }
444 444
445 445
  446 +/**
  447 + * 返回邮件的uuid来区分是否是同一封邮件
  448 + * @return string
  449 + * @author:dc
  450 + * @time 2023/9/18 9:33
  451 + */
  452 +function get_email_uuid($subject,$udate,$folder,$form,$to,$size){
  453 +
  454 + return md5(json_encode([$subject,$udate,$folder,$form,$to,$size]));
  455 +
  456 +}
  457 +
  458 +