function drop($conditions, $fields = 'ad_image,root_image,cate_image') { $this->clear_cache(); $droped_rows = parent::drop($conditions, $fields); if ($droped_rows) { restore_error_handler(); $droped_data = $this->getDroppedData(); foreach ($droped_data as $key => $value) { if ($value['ad_image']) { @unlink(ROOT_PATH . '/' . $value['ad_image']); //删除Logo文件 } if ($value['root_image']) { @unlink(ROOT_PATH . '/' . $value['root_image']); //删除Logo文件 } if ($value['cate_image']) { @unlink(ROOT_PATH . '/' . $value['cate_image']); //删除Logo文件 } } reset_error_handler(); } return $droped_rows; }
function drop($conditions, $fields = '') { $this->clear_cache(); return parent::drop($conditions, $fields); }