$Buy_orderModel = Buy_orderModel::with(['users' => function($query) use ($nickname) { $nickname != '' && $query->where('nickname', 'like', '%' . $nickname . '%'); }])->where(function ($query) use ($status) { $status != '-1' && $query->where('status', $status); })->where(function ($query) use ($timeframe , $time_end) { !empty($time_end) && $query->where('create_time','<=',"$time_end"); !empty($timeframe) && $query->where('create_time','>=',"$timeframe"); })->order('id desc')->paginate($limit, false, [ 'query' => $request->param(), ]);
我采用闭包形式,没有报错但是搜索时间功能不能用。
tp5.1有个坑 时间查询的有时间查询语句
tp5.1的查询 搜索时间
最新推荐文章于 2024-06-30 15:33:23 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)