$list = $this->model
// ->with('sort')
->where($where)
// ->where($pidWhere)
// ->where("pid in ($str)")
->order($sort, $order)
->paginate($limit);
$fields = [
[
'field'=>'sort_ids',//关联数据字段
'primary'=>'id',//关联表主键
'display'=>'sort_title',//附加字段名称
'column'=>'title',//关联表中读取需要显示的字段,显示所有用"*"
// 'model'=>\app\common\model\store'',//关联模型
// 'name'=>'Houseconfig',//模型名称,比table字段少一个前缀
'table'=>'c_sort',//关联表,关联表和关联模型二选一
// 'table'=>'h_house_config',//关联表,关联表和关联模型二选一
// 'type'=>'hasOne',//关联类型
// 'foreignKey'=>'house_config_id',//关联外键
// 'fields'=>['name']
]
];
// 关联查询逗号
addtion($list->items(), $fields);
$rows = $list->items();
效果
