<?php

namespace app\admin\controller;

use app\admin\model\Kfonline;
use app\common\tools;
use app\common\KfjkLogic;
use app\admin\model\Users as UserModel;

class Kfonitoring extends Base
{

    public function kfjiankong()
    {

        $kfgroup = tools::getKfGroup();
        $return = [];

        if (request()->isAjax()) {
            list($groupid, $onlinestatus, $type3) = explode(',', input('get.searchText'));

            $logic = new KfjkLogic();
            $kdidsArray = $logic->getValiKF($groupid, $onlinestatus);
            $return = $logic->getAllData($kdidsArray);

            if (empty($kdidsArray)) {
                $lastreturn['total'] = 0;  //总数据
                $lastreturn['rows'] = [];
            } else {
                $lastreturn['total'] = count($return);  //总数据
                $lastreturn['rows'] = $return;
            }

            return json($lastreturn);
        }
        $this->assign('kfgroup', $kfgroup);
        return $this->fetch('kfonitoring/kfjiankong');
    }


}