#### 问题描述
这里写问题描述
这种写法打印的items是对象
```
$WebUsers = MovieBasic::when(is_numeric($request->input('status')) , function ($query) use ($request) {
return $query->where('status', $request->input('status'));
})->when($request->input('type'), function ($query) use ($request) {
return $query->where('type', $request->input('type'));
})
->paginate($request->get('pageSize'));
$items = $WebUsers->items();
print_r($items);
```
这种写法打印的items正常,是数组
```
$WebUsers =Db::table('movie_basic)->when(is_numeric($request->input('status')) , function ($query) use ($request) {
return $query->where('status', $request->input('status'));
})->when($request->input('type'), function ($query) use ($request) {
return $query->where('type', $request->input('type'));
})
->paginate($request->get('pageSize'));
$items = $WebUsers->items();
print_r($items);
```
model代码
```
class MovieBasic extends Model
{
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'movie_basic';
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'id';
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = false;
}
```