think icon indicating copy to clipboard operation
think copied to clipboard

ThinkPHP Framework ——十年匠心的高性能PHP框架

Results 132 think issues
Sort by recently updated
recently updated
newest added

服务器端500错误,但是接口不会显示任何错误信息,好像跟返回的数据格式有关; 服务器nginx日志: `Stack trace: #0 E:\phpstudy_pro\WWW\c.com\vendor\topthink\framework\src\think\Response.php(385): think\response\Json->output(false) #1 E:\phpstudy_pro\WWW\c.com\vendor\topthink\framework\src\think\Response.php(131): think\Response->getContent() #2 E:\phpstudy_pro\WWW\c.com\vendor\topthink\framework\src\think\initializer\Error.php(58): think\Response->send() #3 E:\phpstudy_pro\WWW\c.com\vendor\topthink\framework\src\think\initializer\Error.php(91): think\initializer\Error->appException(Object(think\exception\ErrorException)) #4 [internal function]: think\initializer\Error->appShutdown() #5 {main} **thrown in E:\phpstudy_pro\WWW\c.com\vendor\topthink\framework\src\think\response\Json.php on line 50" while reading...

![QQ图片20220425091039](https://user-images.githubusercontent.com/31528360/165009743-7acf6df4-a88d-40ff-97e1-2127b19a2243.jpg) ![image](https://user-images.githubusercontent.com/31528360/165009795-14d9ca3e-4f85-4a71-8e2d-779099a8d4ee.png)

版本:ThinkPHP v6.0.12 我定义了一个`service`,在`boot()`或者`register()`方法中使用如下代码动态修改配置信息,会出现部分修改后的配置不生效的问题,代码如下: ```php public function boot() { // 修改文件系统配置 $filesystem = config('filesystem'); $filesystem['disks']['public']['url'] = '/storage/test'; $filesystem['disks']['public']['root'] = $this->app->getRootPath().'public'.DIRECTORY_SEPARATOR.'storage'.DIRECTORY_SEPARATOR.'test'; config(['filesystem' => $filesystem]); // 修改缓存配置 $cache = config('cache'); $cache['stores']['file']['path'] = $this->app->getRuntimePath().'cache'.DIRECTORY_SEPARATOR.'test';...

全局:`app/config/cache.php` `return [ // 默认缓存驱动 'default' => env('cache.driver', 'redis'), // 缓存连接方式配置 'stores' => [ // 文件 'file' => [], // redis 'redis' => [ // 驱动方式 'type' => 'redis' ],...

我有一个文章表、分类表,中间表(post_id,category_id),是通过多对多关联的,当我查询文章列表的时候,需要指定分类id时怎么查询?只能用视图查询吗?

``` 'latest' => ['close' => 1], //最新内容列表 {Article:latest} {$post['title']} {/Article:latest} ``` 上面这样定义的时候没有问题。 ``` 'latest' => ['attr' => 'limit', 'close' => 1], //最新内容列表 {Article:latest} {$post['title']} {/Article:latest} ``` 当我加上参数之后,会报错:模板标签错误:latest limit参数变成必填。 ``` {Article:latest...

TP6官方文档中只提供部分[数据库事件](https://www.kancloud.cn/manual/thinkphp6_0/1037571),不如模型事件齐全;当需要多Db和Model的增删改成都进行监听时,只能使用Db事件,而Db事件不齐全,相关业务需求无法实现。 (think\db\PDOConnection)新增before_update事件示例: ``` /** * 更新记录 * @access public * @param BaseQuery $query 查询对象 * @return integer * @throws PDOException */ public function update(BaseQuery $query): int { $query->parseOptions(); $flag =...

## thinkphp 6.0.8下think-swoole安装成功,但是无法正常运行无法运行,请教如何解决? ``` [root@localhost think-6.0.6]# composer require topthink/think-swoole Do not run Composer as root/super user! See https://getcomposer.org/root for details Continue as root/super user [yes]? yes Using version ^3.1 for...