从数据库中永久删除数据

时间:2017-04-07 14:56:26

标签: codeigniter

您好我需要帮助如何永久删除我的数据库,当我从我的应用程序删除数据时它没有从数据库中删除,控制器使用此删除

/**
 * deleted data | SET is_deleted to true
 */
public function delete() {
    $response = [];
    $ids = explode(',', $this->input->post($this->pk));
    if (count($ids) > 0) {
        if($this->model->delete($ids, $this->table)) {
            $response = [
                'action' => 'delete',
                'type' => 'success',
                'message' => 'deleted',
                'id' => $ids
            ];
        } else {
            $response = [
                'action' => 'delete',
                'type' => 'error',
                'message' => 'not_deleted'
            ];
        }
    } else {
        $response = [
            'action' => 'delete',
            'type' => 'warning',
            'message' => 'not_selected'
        ];

    }

    $this->output
        ->set_content_type('application/json', 'utf-8')
        ->set_output(json_encode($response, JSON_PRETTY_PRINT))
        ->_display();
    exit;
}

0 个答案:

没有答案