table('supplier_street')." where status=1 and is_show=1 and supplier_id in(SELECT DISTINCT supplier_id FROM ". $ecs->table('supplier_shop_config') . " AS ssc WHERE ( code = 'shop_name' AND value LIKE '%$key%' ) OR ( code = 'shop_keywords' AND value LIKE '%$key%' ))"; $arr = $GLOBALS['db']->getAll($sql); foreach($arr as $key=>$val){ $shopinfo = $GLOBALS['db']->getAll("select code,value from ".$GLOBALS['ecs']->table('supplier_shop_config')." where supplier_id=".$val['supplier_id']." and code in('shop_closed','shop_name','shop_keywords')"); foreach($shopinfo as $k => $v){ $v['value'] = str_replace($filter['keywords'],"".$filter['keywords']."",$v['value']); $arr[$key][$v['code']] = $v['value']; } } //file_put_contents('./asd.txt',var_export($arr,true)); //print_r($res); print_r(json_encode($arr)); ?>