当前位置:网站首页>Each traversal usage of tp6
Each traversal usage of tp6
2022-04-23 06:52:00 【Collect and study by yourself】
Closure , Find out the assignment to topic_num attribute $chapterObj = (new TopicChapter()) ->where('question_bank_id', '=', $questionBankId) ->where('is_deleted', '=', 0) ->where('chapter_type', '=', 1) ->order('sort ASC') ->field('id as chapter_id,chapter_name') ->select(); $chapterObj->each(function ($item) use ($questionBankId) { $item->topic_num = (new \app\common\model\v2\Topic())->where(['question_bank_id' => $questionBankId, 'topic_chapter_id' => $item->chapter_id, 'parent_id' => 0, 'is_deleted' => 0, 'organization_id' => 3])->count('id'); });
版权声明
本文为[Collect and study by yourself]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230555551877.html
边栏推荐
猜你喜欢
随机推荐
ASP.NET CORE 配置选项(上篇)
Leak detection and vacancy filling (V)
1-5 NodeJS CommonJs规范
Leetcode刷题之实现strStr()
Scientists say Australian plan to cull up to 10,000 wild horses doesn’t go far enough
JS实现模态框拖拽
.Net Core 下使用 Quartz —— 【6】作业和触发器之触发器的日历
Leak detection and vacancy filling (IX) -- Procedure
关于注解1
js更改全部变量失败后改成return方法,终于解决解决问题
【ORACLE与mysql的区别】
Color string conversion
ASP.NET CORE在类库项目中读取配置文件
关于软件的空间占用,安装目录
并发优化请求
C# webpai 路由详解
Leak detection and filling (I)
ASP.NET CORE 依赖注入服务生命周期
EF CORE在ASP.NET CORE项目中基于数据库优先模式生成实体模型
ASP.NET CORE配置选项(下篇)