$sqlgx="select a.buId,a.billDate,a.billNo,a.transTypeName,a.salesId,a.locationId,a.make,a.invId,a.qty,a.price,a.udf01,b.name as gyname,c.name as invName,c.spec as invSpec,c.unitName,d.name as locationName from ys_bill_info as a
left join
(select id,name from ys_contact where isDelete=0) as b
on a.buId=b.id
left join
(select id,name,spec,unitName from ys_goods where isDelete=0) as c
on a.invId=c.id
left join
(select id,name from ys_storage where isDelete=0) as d
on a.locationId=d.id
where a.transTypeName like '%销货%' and a.isDelete=0 and a.uid=".$_SESSION['AdminID']."".$where." order by a.id desc";
$data = $db->get_all($sqlgx);