$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); })->whereTime('create_time', 'between' ,"$analyze_firstday,$analyze_firstdays")->order('id desc')->paginate($limit, false, [ 'query' => $request->param(), ]); $where['id'] = id; if($name){ $where['$name'] = ['like' ,'%'.$name.'%']; } $data = model('表名')->where(function ($query) use ($where) { $query->where($where); })->order('rulerid asc')->paginate(6, false, [ 'query' =>[ '键名' => '值', 'name' => '小明', 'phone' => '03710461', ] ])->toArray(); paginate 要请求的参数
tp5 分页搜索原理
最新推荐文章于 2024-06-22 00:12:45 发布