摘要: 第一种方式 异常使用工具包,错误码和错误信息,每个项目单独控制,互不影响 本次使用laravel5.7 1 安装laravel 2 composer.json里面引入git项目包 2. app下新建目录 Constants 目录下新建 ErrorCode.php ErrorMsg.php 3.在ap 阅读全文
posted @ 2019-10-09 21:56 brady-wang 阅读(403) 评论(0) 推荐(0)
摘要: 统计关联数量,单个用法 $posts = Post::withCount('comments')->orderBy('id','desc')->paginate(6); 多个用法 $posts = Post::withCount(['comments','zans'])->orderBy('id', 阅读全文
posted @ 2019-10-09 17:44 brady-wang 阅读(1695) 评论(0) 推荐(0)