dataLimit = $cms['diyformdatalimit']; } $this->model = new \app\admin\model\cms\Diyform; $this->view->assign("statusList", $this->model->getStatusList()); } /** * 检测元素是否可用 * @internal */ public function check_element_available() { $id = $this->request->request('id'); $name = $this->request->request('name'); $value = $this->request->request('value'); $name = substr($name, 4, -1); if (!$name) { $this->error(__('Parameter %s can not be empty', 'name')); } if ($id) { $this->model->where('id', '<>', $id); } $exist = $this->model->where($name, $value)->find(); if ($exist) { $this->error(__('The data already exist')); } else { $this->success(); } } }