From 53303f265000e79a700ce3fae07baeba361f1ab3 Mon Sep 17 00:00:00 2001 From: taoser Date: Fri, 5 May 2023 11:57:54 +0800 Subject: [PATCH] 2.2.5 --- app/admin/controller/addon/Addons.php | 4 ++-- app/admin/view/content/forum/add.html | 5 ++++- app/admin/view/content/forum/edit.html | 3 ++- app/admin/view/public/admin_base.html | 2 +- app/admin/view/public/admin_form.html | 2 +- app/common/model/Article.php | 2 +- composer.lock | 12 ++++++------ config/taoler.php | 2 +- vendor/composer/autoload_psr4.php | 2 +- vendor/composer/autoload_static.php | 4 ++-- vendor/composer/installed.json | 14 +++++++------- vendor/composer/installed.php | 10 +++++----- vendor/services.php | 2 +- vendor/topthink/think-orm/src/db/PDOConnection.php | 6 ++---- .../think-orm/src/model/concern/RelationShip.php | 4 +++- 15 files changed, 39 insertions(+), 35 deletions(-) diff --git a/app/admin/controller/addon/Addons.php b/app/admin/controller/addon/Addons.php index c8141a2..bf70dbe 100644 --- a/app/admin/controller/addon/Addons.php +++ b/app/admin/controller/addon/Addons.php @@ -309,9 +309,9 @@ class Addons extends AdminController //$pid = AuthRule::where('name','addons')->value('id'); return json(['code'=>-1,'msg'=> 'is_nav菜单项目设置错误']); } - // 开启关闭的父ID状态 + // 父ID状态为0时打开 $pidStatus = AuthRule::where('id', $pid)->value('status'); - if(!$pidStatus) { + if($pidStatus < 1) { AuthRule::update(['status' => 1, 'id' => $pid]); } // 安装菜单 diff --git a/app/admin/view/content/forum/add.html b/app/admin/view/content/forum/add.html index f99bee6..5c1d6bf 100644 --- a/app/admin/view/content/forum/add.html +++ b/app/admin/view/content/forum/add.html @@ -39,7 +39,7 @@
- +
@@ -85,12 +85,14 @@
+ diff --git a/app/admin/view/public/admin_form.html b/app/admin/view/public/admin_form.html index 0ef4131..89132fe 100644 --- a/app/admin/view/public/admin_form.html +++ b/app/admin/view/public/admin_form.html @@ -5,7 +5,7 @@ {block name="title"}TaoLerCMS后台管理系统{/block} - + {block name="body"}内容{/block} diff --git a/app/common/model/Article.php b/app/common/model/Article.php index 641432c..26c7f08 100644 --- a/app/common/model/Article.php +++ b/app/common/model/Article.php @@ -73,7 +73,7 @@ class Article extends Model $data['status'] = $superAdmin ? 1 : Config::get('taoler.config.posts_check'); $msg = $data['status'] ? '发布成功' : '发布成功,请等待审核'; $result = $this->save($data); - if($result == true) { + if($result) { return ['code' => 1, 'msg' => $msg, 'data' => ['status' => $data['status'], 'id'=> $this->id]]; } else { return ['code' => -1, 'msg'=> '添加文章失败']; diff --git a/composer.lock b/composer.lock index ae9d29f..b071735 100644 --- a/composer.lock +++ b/composer.lock @@ -3031,16 +3031,16 @@ }, { "name": "topthink/think-orm", - "version": "v2.0.59", + "version": "v2.0.60", "source": { "type": "git", "url": "https://github.com/top-think/think-orm.git", - "reference": "ac0f18bc3063ca924ed5b4af6e405d74f44d2870" + "reference": "8bc34a4307fa27186c0e96a9b3de3cb23aa1ed46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-orm/zipball/ac0f18bc3063ca924ed5b4af6e405d74f44d2870", - "reference": "ac0f18bc3063ca924ed5b4af6e405d74f44d2870", + "url": "https://api.github.com/repos/top-think/think-orm/zipball/8bc34a4307fa27186c0e96a9b3de3cb23aa1ed46", + "reference": "8bc34a4307fa27186c0e96a9b3de3cb23aa1ed46", "shasum": "", "mirrors": [ { @@ -3086,9 +3086,9 @@ ], "support": { "issues": "https://github.com/top-think/think-orm/issues", - "source": "https://github.com/top-think/think-orm/tree/v2.0.59" + "source": "https://github.com/top-think/think-orm/tree/v2.0.60" }, - "time": "2023-03-06T10:12:41+00:00" + "time": "2023-03-19T04:51:56+00:00" }, { "name": "topthink/think-template", diff --git a/config/taoler.php b/config/taoler.php index b231272..c29298a 100644 --- a/config/taoler.php +++ b/config/taoler.php @@ -16,7 +16,7 @@ return [ // 应用名,此项不可更改 'appname' => 'TaoLer', // 版本配置 - 'version' => '2.2.4', + 'version' => '2.2.5', // 加盐 'salt' => 'taoler', // 数据库备份目录 diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 5a6252d..193cd77 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -14,7 +14,7 @@ return array( 'think\\composer\\' => array($vendorDir . '/topthink/think-installer/src'), 'think\\captcha\\' => array($vendorDir . '/topthink/think-captcha/src'), 'think\\app\\' => array($vendorDir . '/topthink/think-multi-app/src'), - 'think\\' => array($vendorDir . '/topthink/framework/src/think', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src', $vendorDir . '/topthink/think-template/src'), + 'think\\' => array($vendorDir . '/topthink/framework/src/think', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-template/src', $vendorDir . '/topthink/think-orm/src'), 'taoser\\think\\' => array($vendorDir . '/taoser/think-auth/src'), 'taoser\\' => array($vendorDir . '/taoser/think-addons/src', $vendorDir . '/taoser/think-setarr/src'), 'phpspirit\\databackup\\' => array($vendorDir . '/lotofbadcode/phpspirit_databackup/src'), diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index cd1ad7c..9b14287 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -182,8 +182,8 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2 array ( 0 => __DIR__ . '/..' . '/topthink/framework/src/think', 1 => __DIR__ . '/..' . '/topthink/think-helper/src', - 2 => __DIR__ . '/..' . '/topthink/think-orm/src', - 3 => __DIR__ . '/..' . '/topthink/think-template/src', + 2 => __DIR__ . '/..' . '/topthink/think-template/src', + 3 => __DIR__ . '/..' . '/topthink/think-orm/src', ), 'taoser\\think\\' => array ( diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 8d9ce99..334909f 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -3028,17 +3028,17 @@ }, { "name": "topthink/think-orm", - "version": "v2.0.59", - "version_normalized": "2.0.59.0", + "version": "v2.0.60", + "version_normalized": "2.0.60.0", "source": { "type": "git", "url": "https://github.com/top-think/think-orm.git", - "reference": "ac0f18bc3063ca924ed5b4af6e405d74f44d2870" + "reference": "8bc34a4307fa27186c0e96a9b3de3cb23aa1ed46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-orm/zipball/ac0f18bc3063ca924ed5b4af6e405d74f44d2870", - "reference": "ac0f18bc3063ca924ed5b4af6e405d74f44d2870", + "url": "https://api.github.com/repos/top-think/think-orm/zipball/8bc34a4307fa27186c0e96a9b3de3cb23aa1ed46", + "reference": "8bc34a4307fa27186c0e96a9b3de3cb23aa1ed46", "shasum": "", "mirrors": [ { @@ -3058,7 +3058,7 @@ "require-dev": { "phpunit/phpunit": "^7|^8|^9.5" }, - "time": "2023-03-06T10:12:41+00:00", + "time": "2023-03-19T04:51:56+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -3086,7 +3086,7 @@ ], "support": { "issues": "https://github.com/top-think/think-orm/issues", - "source": "https://github.com/top-think/think-orm/tree/v2.0.59" + "source": "https://github.com/top-think/think-orm/tree/v2.0.60" }, "install-path": "../topthink/think-orm" }, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 3c4ef37..303955d 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'taoser/taoler', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '9c2eddaed601bdb6e510f417c528a79129611a4b', + 'reference' => 'dcfb9c2a8181fb002fee01a04843002e53a68e20', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -358,7 +358,7 @@ 'taoser/taoler' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '9c2eddaed601bdb6e510f417c528a79129611a4b', + 'reference' => 'dcfb9c2a8181fb002fee01a04843002e53a68e20', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -455,9 +455,9 @@ 'dev_requirement' => false, ), 'topthink/think-orm' => array( - 'pretty_version' => 'v2.0.59', - 'version' => '2.0.59.0', - 'reference' => 'ac0f18bc3063ca924ed5b4af6e405d74f44d2870', + 'pretty_version' => 'v2.0.60', + 'version' => '2.0.60.0', + 'reference' => '8bc34a4307fa27186c0e96a9b3de3cb23aa1ed46', 'type' => 'library', 'install_path' => __DIR__ . '/../topthink/think-orm', 'aliases' => array(), diff --git a/vendor/services.php b/vendor/services.php index 4399c44..8c31fb6 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'taoser\\addons\\Service', diff --git a/vendor/topthink/think-orm/src/db/PDOConnection.php b/vendor/topthink/think-orm/src/db/PDOConnection.php index 4e9b791..54dd9d3 100644 --- a/vendor/topthink/think-orm/src/db/PDOConnection.php +++ b/vendor/topthink/think-orm/src/db/PDOConnection.php @@ -354,15 +354,13 @@ abstract class PDOConnection extends Connection if (!isset($this->info[$schema]) || $force) { // 读取字段缓存 $cacheKey = $this->getSchemaCacheKey($schema); - $cacheField = $this->config['fields_cache'] && !empty($this->cache); - - if ($cacheField && !$force) { + if ($this->config['fields_cache'] && !empty($this->cache) && !$force) { $info = $this->cache->get($cacheKey); } if (empty($info)) { $info = $this->getTableFieldsInfo($tableName); - if ($cacheField) { + if (!empty($this->cache) && ($this->config['fields_cache'] || $force)) { $this->cache->set($cacheKey, $info); } } diff --git a/vendor/topthink/think-orm/src/model/concern/RelationShip.php b/vendor/topthink/think-orm/src/model/concern/RelationShip.php index 8e0d498..37b8af8 100644 --- a/vendor/topthink/think-orm/src/model/concern/RelationShip.php +++ b/vendor/topthink/think-orm/src/model/concern/RelationShip.php @@ -735,7 +735,9 @@ trait RelationShip protected function getRelationData(Relation $modelRelation) { if ($this->parent && !$modelRelation->isSelfRelation() - && get_class($this->parent) == get_class($modelRelation->getModel())) { + && get_class($this->parent) == get_class($modelRelation->getModel()) + && $modelRelation instanceof OneToOne + ) { return $this->parent; }