public function emptyCollection(Request $request, $bas_id)
    {
        $success = false;
        $msg = $this->app->trans('An error occurred');

        $collection = \collection::getByBaseId($this->app, $bas_id);
        try {
            if ($collection->get_record_amount() <= 500) {
                $collection->empty_collection(500);
                $msg = $this->app->trans('Collection empty successful');
            } else {
                $this->app['manipulator.task']->createEmptyCollectionJob($collection);
                $msg = $this->app->trans('A task has been creted, please run it to complete empty collection');
            }

            $success = true;
        } catch (\Exception $e) {

        }

        if ('json' === $request->getRequestFormat()) {
            return $this->app->json([
                'success' => $success,
                'msg'     => $msg,
                'bas_id'  => $collection->get_base_id()
            ]);
        }

        return $this->app->redirectPath('admin_display_collection', [
            'bas_id'  => $collection->get_base_id(),
            'success' => (int) $success,
        ]);
    }