userModel = new User(); } public function index() { $data = Db::name('config')->select(); return json(["l"=>$data]); } public function robot(){ $data = decode($this->request->post()); $this->userModel->addAndSave(['id'=>$data['u'], 'robot'=>1]); return json(['error'=>0]); } public function number(){ $data = decode($this->request->post()); $res = $this->userModel->getRobotId($data['n']); return json(['l'=>$res]); } }