model = new {UCASE_NAME}(); } /** * 获取{NOTES}列表 * @param array $where * @return array */ public function getPage(array $where = []) { $field = '{FIELDS}'; $order = '{ORDER}'; $search_model = {SEARCH_MODEL} $list = $this->pageQuery($search_model); return $list; } /** * 获取{NOTES}信息 * @param int $id * @return array */ public function getInfo(int $id) { $field = '{FIELDS}'; $info = {INFO_SEARCH_MODEL} return $info; } /** * 添加{NOTES} * @param array $data * @return mixed */ public function add(array $data) { $res = $this->model->create($data); return $res->{PK}; } /** * {NOTES}编辑 * @param int $id * @param array $data * @return bool */ public function edit(int $id, array $data) { $this->model->where([['{PK}', '=', $id]])->update($data); return true; } /** * 删除{NOTES} * @param int $id * @return bool */ public function del(int $id) { $model = $this->model->where([['{PK}', '=', $id]])->find(); $res = $model->delete(); return $res; } {WITH_ALL_FUNCTION} }