From ab3a58b74e59acf6bfd406070c09681fd989c946 Mon Sep 17 00:00:00 2001 From: molong Date: Thu, 22 Jun 2017 10:54:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=83=A8=E5=88=86=E5=87=BD?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common.php | 40 +--------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/application/common.php b/application/common.php index 9a7ad5b8..4a7d1f94 100644 --- a/application/common.php +++ b/application/common.php @@ -900,45 +900,7 @@ function get_attribute_type($type = '') { return $type ? $type_list[$type][0] : $type_list; } -/** - * 获取文档模型信息 - * @param integer $id 模型ID - * @param string $field 模型字段 - * @return array - */ -function get_document_model($id = null, $field = null) { - static $list; - - /* 非法分类ID */ - if (!(is_numeric($id) || is_null($id))) { - return ''; - } - - /* 读取缓存数据 */ - if (empty($list)) { - $list = cache('document_model_list'); - } - - /* 获取模型名称 */ - if (empty($list)) { - $map = array('status' => 1, 'is_bind_category' => 1); - $model = db('Model')->where($map)->field(true)->select(); - foreach ($model as $value) { - $list[$value['id']] = $value; - } - cache('document_model_list', $list); //更新缓存 - } - - /* 根据条件返回数据 */ - if (is_null($id)) { - return $list; - } elseif (is_null($field)) { - return $list[$id]; - } else { - return $list[$id][$field]; - } -} - +//获得内容状态 function get_content_status($status) { $text = array( '-1' => '删除',