/* model实例化*/
$list = self::where($where)
->with(['user''node'])
->alias('log')
->field('log.idlog.user_idlog.rate(log.u + log.d) as origin_trafficlog.trafficlog.log_timelog.node_id')
->order($order)
->paginate([
'query' => Request::get()
'list_rows' => $pageSize
]);
$ids = $list->toarray(); //重新的整理数组
$ids = array_values(array_column($ids["data"]'daili_code')); //获取数组中指定列,并去除键名
$ids = implode("" $ids); //格式化数组
/* 空值处理 */
if(!$ids){
$ids=[];
array_push($ids'0');
}
$daili = Db::name('app_daili')->where('daili_code''in'$ids)->field('name')->select(); //输出
评论