当前位置:网站首页>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
边栏推荐
猜你喜欢

【ES6】 Promise相关(事件循环,宏/微任务,promise,await/await)

Parse PSD files and map them into components

Redux概述

.Net Core 下使用 Quartz —— 【4】作业和触发器之作业属性和异常

freeCodeCamp----time_calculator练习

压力测试工具 Jmeter

ASP.NET CORE JWT认证

leetcode之爬楼梯方法数

js中entries(),keys(),values() , some(), Object.assign()遍历数组用法

.Net Core 下使用 Quartz —— 【3】作业和触发器之作业传参
随机推荐
常用网站汇总
sql中的 IF 条件语句的用法
C# Dapper 基本使用 增删改查事务等
Kids and COVID: why young immune systems are still on top
Scientists say Australian plan to cull up to 10,000 wild horses doesn’t go far enough
深入理解控制反转和依赖注入
todesk远程控制软件的使用
mysql中sum (if)_mysql 中sum (if())
Mysql中的索引与视图
PHP 无限极分类和树形
CentOS8搭建PHP8.0.3运行环境
Leak detection and vacancy filling (III)
freeCodeCamp----arithmetic_arranger练习
1-4 NodeJS的安装之配置可执行脚本
Arm common assembly instructions
启用AHCI后无法启动系统
.Net Core 下使用 Quartz —— 【4】作业和触发器之作业属性和异常
ASP.NET CORE3.1 Identity注册用户后登录失败的解决方案
SignalR实现从服务端主动发送数据到客户端
1-3 组件与模块