From 0f44ef656f680be868c4da71189938e1e7a7cd8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= Date: Thu, 11 Mar 2021 09:44:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AA=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=A0=B9=E7=BB=93=E7=82=B9=E7=9A=84=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/models/infoStructures_model.php | 26 +++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/application/models/infoStructures_model.php b/application/models/infoStructures_model.php index 5bc64e3e..beb2ad62 100644 --- a/application/models/infoStructures_model.php +++ b/application/models/infoStructures_model.php @@ -217,4 +217,30 @@ class InfoStructures_model extends CI_Model } } + /** + * @description: 用于生成一个特殊的根结点is_level和is_sort都为0,CT移动优先项目用 + * @param {type} + * @return: + * @Date Changed: + */ + public function AddRootNote($is_ic_id){ + $sql = "INSERT INTO infoStructures \n" + . " ( \n" + . " is_parent_id, is_path, is_level, is_sort, is_sitecode, is_datetime, is_ic_id \n" + . " ) \n" + . "VALUES \n" + . " ( \n" + . " ?, ?, ?, ?, ?, getdate(), ? \n" + . " )"; + $query = $this->HT->query($sql, array(-99, '', 0, 0, $this->config->item('site_code'), $is_ic_id)); + $this->insert_id = $this->HT->last_id('infoStructures'); + //把自己的ID加到path上 + $set_sql = "UPDATE infoStructures \n" + . "SET is_path = is_path + CONVERT(VARCHAR(200), is_id) + ',' \n" + . "WHERE is_id = ?"; + $query = $this->HT->query($set_sql, array($this->insert_id)); + + return $this->insert_id; + } + } \ No newline at end of file