作者 邓超

1

... ... @@ -365,6 +365,12 @@ class Home extends Base {
if(empty($to_folder)){
app()->e('folder_move_error');
}
if($to_folder == '草稿箱'){
app()->e('folder_move_to_draft_error');
}
if($to_folder == '发件箱'){
app()->e('folder_move_to_send_error');
}
$data = db()->all(listsSql::first(dbWhere(['id'=>$mail_ids,'email_id'=>array_column($emails,'id')]),'`id`,`uid`,`email_id`,`folder_id`'));
if($data){
... ... @@ -372,6 +378,18 @@ class Home extends Base {
$emails = array_column($emails,null,'id');
$uids = [];
foreach ($data as $datum){
// 只有草稿箱才没有uid
if(!$datum['uid']){
// 删除
if ($to_folder == '回收站'){
// 删除数据,真实删除
db()->delete(listsSql::$table,[
'id' => $datum['id']
]);
continue;
}
}
if(empty($uids[$datum['email_id']])){
$uids[$datum['email_id']][$datum['folder_id']] = [];
}
... ...
... ... @@ -88,6 +88,9 @@ return [
'send_timer_job_error' => '延迟发送失败',
'folder_move_to_draft_error' => '无法移动到草稿箱',
'folder_move_to_send_error' => '无法移动到发件箱',
... ...
... ... @@ -183,14 +183,20 @@ class DbPool {
}
/**
* 删除语句
* 删除语句 软删
* @param string $table
* @param array $where
* @param null $upFiled
* @return int
* @author:dc
* @time 2023/3/17 18:04
* @time 2023/4/11 14:47
*/
public function delete(string $table, array $where){
public function delete(string $table, array $where,$upFiled=null){
if($upFiled){
return $this->update($table,[$upFiled === true ? 'deleted_at' : $upFiled =>time()],$where);
}
$sql = "delete from `{$table}` where ".dbUpdate($where);
$query = $this->query($sql);
... ...