ThinkPHP5 闭包查询 Query where 查询条件为变量时候use
2019-09-13 18:413766
->where(function (Query $query) use ($currentCid) { if (!empty($currentCid)) { $query->where('id', 'neq', $currentCid); } })$currentCid为变量,注意代码中的
use ($currentCid)
上一篇: m_substr字符串截取