tp6.0闭包子查询调用外部变量
function() use() { }
-------------------------------------------
$newdate=date('Y-m-d H:i:s',strtotime("-$v1[1] day"));
$data['list']=Db::name('apply') ->where('sbid', 'IN', function ($query) use ($newdate){
$query->name('apply')->field('sbid')->where('servicestate',1 )->where('renddate','>=',$newdate);
})
->select();