public function index() { $query = RKit::getData('search_txt'); if (!empty($query['search_txt'])) { $this->bindModel->where('area_name like ("%' . $query['search_txt'] . '%")'); } $this->setData('search', $query['search_txt']); $this->lists($query); }
public function doUpload() { $params = $this->getData('params'); $upload = array('Field' => 'file'); $file = $_FILES['file']; $fileUrl = RKit::doAttachment("upload", $upload); $resource = array('size' => $file["size"], 'oname' => $file["name"], 'resource_url' => $fileUrl); if ($fileUrl !== FALSE) { $this->_addResource($resource); } $params = '{\\"params\\":' . $params . ',\\"files\\":"' . $fileUrl . '"}'; echo '<script>window.parent.callback_upload(\'' . $params . '\');</script>'; exit; }
/** * 输出ajax信息 * @param int $statusCode * @param string $msg * @param array $data */ protected function echoAjax($statusCode, $msg, $data = array()) { $response = array('status' => (int) $statusCode, 'msg' => $msg); RKit::printJson(array_merge($response, $data)); }
/** * 记录日志 * @param string $msg */ protected function log($msg) { RKit::appendFileLog($this->rauth->getUserInfo('employmentId'), $this->rauth->getUserInfo('loginName'), $this->activeModule, $msg); }
public function saveBefore($isInsert) { if ($isInsert) { $this->upass = isset($this->upass) && !empty(trim($this->upass)) ? RKit::makePwd($this->uname . $this->upass) : RKit::makePwd($this->uname . DEFAULTPWD); $this->reg_date = time(); $this->reg_ip = $this->input->ip_address(); } }