(转载)Laravel with() 使用 limit 或者 take 的问题

原文地址: 问题假设现在我想从每一篇文章中获取其中 15 条评论。代码如下:```phparticle::with(['comments' = function($query) { $querytake(10);}])get();```执行以上代码,发现take()并没有作用。因为 Laravel 只用一条语句预加载关系,当我们在关系中加入...
 阅读数  2788
阅读全文

(转载)laravel 使用消息通知Database通道实现站内信

使用 Laravel 开发一个站内信的功能
 阅读数  2490
阅读全文

ThinkPHP各种写入数据方式批量插入数据性能对比

今天想着自己实测一下但是由于平时用的框架不同,并且由于电脑配置问题,在Innodb测试时耗费过大,所以今天专门测试了一下TP框架下批量写入数据的情况,我们以写入20万数据作为测试数据数据表设计如下:环境:框架:Th...
 阅读数  8145
阅读全文

tp5 中 Argument 1 passed to think\Hook::import() must be of the type array, integer given 问题的解决

现在在做的项目使用的失TP5框架,今天在手动创建创建新模块的时候,发生了一个问题,错误提示是 Argument 1 passed to think\Hook::import() must be of the type array, integer given, called in D:\virtualhost\changzhi\cz_erp\thinkphp\library\think\App.p...
 阅读数  11350
阅读全文

tp5 get参数和路由参数获取问题

以下面的路由为例```bashRoute::get('hello/:id','index/test/hello');```在hello方法中执行以下内容```bashdump(input('get.id'));dump(input());dump(request()get());dump(request()get('id'));dump(request()p...
 阅读数  6243
阅读全文