当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
todesk远程控制软件的使用
TP5 error reporting variable type error: array solution
Set and map
TP5中的getField()方法变化,tp5获取单个字段值
Jenkins搭建与使用
.Net Core3.1 使用 RazorEngine.NetCore 制作实体生成器 (MVC网页版)
New type of dark energy could solve Universe expansion mystery
Multi cycle verification of El form
JS实现模态框拖拽
Arm common assembly instructions
Use of C language and
Color string conversion
Devexpress Gridview 添加全选列
C language structure specifying initialization
百度地图基础案例
不用登录直接下载PNG图标的一个网站
freeCodeCamp----arithmetic_arranger练习
freeCodeCamp----prob_calculator练习
使用jsonwebtoken生成访问密钥
el-date-picker限制选择范围,从当前时间到两个月前