table("tab_adv as a") ->field("a.title,a.data,a.url") ->join("left join tab_adv_pos p on p.id=a.pos_id") ->where($map) ->where("a.end_time > $now or a.end_time = 0") ->order("a.sort desc") ->limit($limit) ->select(); foreach ($data as $key => $val) { $cover = get_cover($val['data'],'path'); if(strpos($cover, 'http')!==false){ $cover = $cover; }else{ $cover = 'http://'.$_SERVER['HTTP_HOST'].$cover; } $data[$key]['data'] = $cover; } return $data; } }