$list = $this->agent->where($where) ->withAttr(‘region‘,function ($value,$data){ $provice_name = regionIdToName($data[‘province_id‘]); $city_name = regionIdToName($data[‘city_id‘]); $county_name = regionIdToName($data[‘county_id‘]); $stree_name = regionIdToName($data[‘stree_id‘]); return $provice_name .= empty($city_name)?‘‘:‘ - ‘.$city_name .= empty($county_name)?‘‘:‘ - ‘.$county_name .= empty($stree_name)?‘‘:‘ - ‘.$stree_name; }) ->append([‘region‘]) ->page($page) ->limit($limit) ->select();
需要使用append进行参数附加
原文地址:https://www.cnblogs.com/lixihuan/p/12030637.html
时间: 2024-11-02 19:26:49