...
|
...
|
@@ -189,15 +189,19 @@ class Folder extends Base { |
|
|
public function delete(){
|
|
|
$email = $this->getEmail();
|
|
|
|
|
|
$folder_id = app()->request('folder_id');
|
|
|
$folder_id = app()->request('id');
|
|
|
|
|
|
$folder = db()->first(folderSql::first(dbWhere(['id'=>$folder_id,'email_id'=>$email['id']])));
|
|
|
$folder = db()->first(folderSql::first(['id'=>$folder_id,'email_id'=>$email['id']]));
|
|
|
|
|
|
if(!$folder){
|
|
|
app()->e('folder_not_fount');
|
|
|
}
|
|
|
// 是否是不可删除的
|
|
|
if(in_array($folder['folder'],array_values(folderAliasMap()))){
|
|
|
app()->e('folder_not_allowed_to_delete');
|
|
|
}
|
|
|
// 是否存在下级
|
|
|
if(db()->count(folderSql::first(dbWhere(['pid'=>$folder['pid'],'email_id'=>$email['id']])))){
|
|
|
if(db()->count(folderSql::first(['pid'=>$folder['pid'],'email_id'=>$email['id']]))){
|
|
|
app()->e('folder_delete_exist_child');
|
|
|
}
|
|
|
|
...
|
...
|
|