<?php

namespace app\admin\controller;

use think\facade\View;
use think\Request;
use app\common\controller\Common;
use think\facade\Db;

/**
 * 系统设置控制器
 * Class Set
 * @package app\admin\controller
 */
class Clean extends Common
{
    /**
     * 评价设置
     * @return string
     */
    public function index()
    {
        return View::fetch();
    }

    public function all()
    {
        Db::name('im_visitors')->where(1)->delete();
        Db::name('im_visitors_info')->where(1)->delete();
        Db::name('im_record')->where(1)->delete();

        return json(['code' => 200, 'data' => '操作成功']);
    }

    public function user()
    {
        Db::name('im_visitors')->where(1)->delete();
        Db::name('im_visitors_info')->where(1)->delete();

        return json(['code' => 200, 'data' => '操作成功']);
    }

    public function record()
    {
        Db::name('im_record')->where(1)->delete();

        return json(['code' => 200, 'data' => '操作成功']);
    }

}
