作者 邓超

x

@@ -418,32 +418,20 @@ class Mail { @@ -418,32 +418,20 @@ class Mail {
418 } 418 }
419 419
420 // 插入数据库 420 // 插入数据库
  421 + // 主题太长了就截取掉
  422 + $data['subject'] = mb_substr($data['subject'],0,3500);
421 try { 423 try {
422 - // 主题太长了就截取掉  
423 - $data['subject'] = mb_substr($data['subject'],0,3500);  
424 - $id = $db->insert(listsSql::$table,$data);  
425 - // 插入失败,尝试更新  
426 - if(!$id){  
427 - $db->update(listsSql::$table,$data,dbWhere([  
428 - 'email_id'=> $data['email_id'],  
429 - 'folder_id' => $data['folder_id'],  
430 - 'uid' => $data['uid']  
431 - ]));  
432 - }  
433 -// if($id){  
434 - // 同步body内容  
435 -// redis()->rPush('sync_email_body', [  
436 -// 'lists_id' => $id,  
437 -// 'email_id' => $email_id,  
438 -// 'folder_id' => $folder_id,  
439 -// 'folder' => $folder,  
440 -// 'uid' => $data['uid'],  
441 -// ]);  
442 -// } 424 + $id = $db->throw()->insert(listsSql::$table,$data);
443 }catch (\Throwable $e){ 425 }catch (\Throwable $e){
444 - 426 + // 插入失败,尝试更新
  427 + $db->update(listsSql::$table,$data,dbWhere([
  428 + 'email_id'=> $data['email_id'],
  429 + 'folder_id' => $data['folder_id'],
  430 + 'uid' => $data['uid']
  431 + ]));
445 } 432 }
446 433
  434 +
447 $results[$key] = []; 435 $results[$key] = [];
448 } 436 }
449 } 437 }