public function send() { $to = $this->getString('to'); $title = $this->getString('title'); $content = $this->getString('content'); $taskId = $this->getString('taskId'); common\loadClass::getService('Mail')->send($to, $title, $content, $taskId); return null; }
public function online() { $olUids = common\Utils::online(); $idsArr = \array_keys($olUids); $where = "id in (" . implode(',', $idsArr) . ")"; $userInfo = common\loadClass::getService('User')->fetchWhere($where); $result = array(); foreach ($userInfo as $user) { $result[$user->id] = $user->hash(); } return $result; }
public function savereg() { $username = $this->getString($this->params, 'username'); $password = $this->getString($this->params, 'password'); $icon = $this->getString($this->params, 'icon', 'noface.jpg'); $service = common\loadClass::getService('User'); $result = $service->addUser($username, $password, $icon); if ($result) { return common\Utils::jump("main", "main", array("msg" => "注册成功")); } return common\Utils::showMsg("注册失败"); }
public function getOnlineList() { $olUids = common\Utils::online(); if (empty($olUids)) { return array(); } $idsArr = \array_keys($olUids); $where = "id in (" . implode(',', $idsArr) . ")"; $userInfo = common\loadClass::getService('User')->fetchWhere($where); $result = array(); foreach ($userInfo as $user) { $result[$user->id] = $user->hash(); } $this->sendOne(Request::getFd(), common\Cmd::OLLIST, $result); }
private function initUsedModel() { $pattern = "/(Model)\$/si"; $vars = get_class_vars(get_class($this)); $models = common\Utils::preg_grep_keys($pattern, $vars); if (!empty($models)) { foreach ($models as $model) { $this->{$model} = common\loadClass::getModel($model); } } //add Service $servicePattern = "/(Service)\$/si"; $services = common\Utils::preg_grep_keys($servicePattern, $vars); if (!empty($services)) { foreach ($services as $service) { $this->{$service} = common\loadClass::getService($service); } } }
public function offline() { common\loadClass::getService('Chat')->offline(); }