<?php

namespace app\admin\model;

use think\Model;

/**
 * 智能问答分组模型
 */
class Kfonline extends Model
{
    public function getOnlineAll($status = '')
    {
        $status = intval($status);
        $return = [];
        if (!$status) {
            $rets = $this->all();
        } else {
            $rets = $this->where(['status' => $status])->select();
        }

        if ($rets) {
            foreach ($rets as $ret) {
                $return[$ret->uid] = trim($ret->uid,'KF');
            }
        }
        return $return;
    }

    public function user()
    {
        $this->hasOne('Users', 'uid', 'id');
    }

}
