From b3f52b21d123f104f7a5be51b8b36dbc5dba28a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BF=97=E5=BC=BA?= <357099073@qq.com> Date: Tue, 17 Mar 2026 17:22:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E9=80=82=E9=85=8Dphp7.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/Index.php | 7 ------- thinkphp/library/think/Response.php | 10 ++++++++-- thinkphp/library/think/db/Connection.php | 5 ++--- thinkphp/library/think/db/Query.php | 2 +- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/application/index/controller/Index.php b/application/index/controller/Index.php index 16832eb..7a5430f 100644 --- a/application/index/controller/Index.php +++ b/application/index/controller/Index.php @@ -6,13 +6,6 @@ use think\facade\Session; class Index { - public function index() - { - $url = "http://www.5cctv.net/wp-content/plugins/erphpdown/payment/vmq/notify.php?payId=190717101020112222981¶m=order[7876632]&type=1&price=1&reallyPrice=1&sign=2398a2492db0616381a85c1fedc51a11"; - return $this->getCurl($url); - - //return 'by:vone'; - } public function getReturn($code = 1, $msg = "成功", $data = null) { diff --git a/thinkphp/library/think/Response.php b/thinkphp/library/think/Response.php index 5fa5402..70492ac 100644 --- a/thinkphp/library/think/Response.php +++ b/thinkphp/library/think/Response.php @@ -395,7 +395,7 @@ class Response if (null == $this->content) { $content = $this->output($this->data); - if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable([ + if (null !== $content && !is_string($content) && !is_numeric($content) && !is_bool($content) && !is_array($content) && !is_callable([ $content, '__toString', ]) @@ -403,7 +403,13 @@ class Response throw new \InvalidArgumentException(sprintf('variable type error: %s', gettype($content))); } - $this->content = (string) $content; + if (is_bool($content)) { + $this->content = $content ? 'true' : 'false'; + } elseif (is_array($content)) { + $this->content = json_encode($content); + } else { + $this->content = (string) $content; + } } return $this->content; diff --git a/thinkphp/library/think/db/Connection.php b/thinkphp/library/think/db/Connection.php index af27fd6..348a501 100644 --- a/thinkphp/library/think/db/Connection.php +++ b/thinkphp/library/think/db/Connection.php @@ -1813,11 +1813,10 @@ abstract class Connection * @access public * @return integer */ - public function getExecuteTimes() + public function getExecuteTimes() { - return Db::$executeTimes; + return json(['times' => Db::$executeTimes]); } - /** * 关闭数据库(或者重新连接) * @access public diff --git a/thinkphp/library/think/db/Query.php b/thinkphp/library/think/db/Query.php index dea5fa7..72c09ab 100644 --- a/thinkphp/library/think/db/Query.php +++ b/thinkphp/library/think/db/Query.php @@ -565,7 +565,7 @@ class Query $seq = (ord(substr($type($value), 0, 1)) % $rule['num']) + 1; } else { // 按照字段的首字母的值分表 - $seq = (ord($value{0}) % $rule['num']) + 1; + $seq = (ord($value[0]) % $rule['num']) + 1; } } return $this->getTable() . '_' . $seq;