thinkphp5.0 多表模糊查询 结果只能出来A表的模糊信息 B 表却丝毫不起作用?求助帮忙看下 下面的代码哪里有问题??
$res=db('shop_info')->alias("a")->join('shop_goods b', ' b.shopid = a.id ')->field("a.id,a.shopname,a.addres,a.shopcbd,a.categoryname,a.opentime,a.closetime,a.categorypath,a.phone as telephone,a.shoppic,a.notice,a.shopstory,a.shopicon,a.salemode,a.longitude as lng,a.latitude as lat,(2 * 6378.137 * ASIN(SQRT(POW( SIN( PI( ) * ( ".$params['longitude']."- a.longitude ) / 360 ), 2 ) + COS( PI( ) * ".$params['latitude']." / 180 ) * COS( a.latitude * PI( ) / 180 ) * POW( SIN( PI( ) * ( " .$params['latitude']. "-a.latitude ) / 360 ), 2 )))) AS distance,b.goodsname,b.id as goodsid,b.onlineprice,b.originalprice,b.goodscover")->where("a.runstate=2 and a.city='".$params['cityName']."' and ( ( a.shopname like '%".$keyword."%') or ( b.goodsname like '%".$keyword."%' ))")->order('distance asc')->limit($start,$pageSize)->select();//a.runstate=2 and ( a.shopname like '% $keyword %' or b.goodsname like '%$keyword%')"