select t1.fbillnum,
       t1.fname,
       t1.fphonenumber,--客户手机
       t1.fcommunity,
       t1.fnumber,
       t1.fdate,
       t1.fnotes,--订单备注
       t1.forderamount,--成交金额
       t1.freceivablesamount,--应收款
       t1.tcustomer_receptid,
       t1.fispayout,--是否已结清
       t1.fstatus,
       t1.tagentsid,--经销商ID
       t1.tcustomerid--客户档案ID
from tcustomer_reception t1
where t1.ftype = '销售'
  and t1.siteid =$siteid$
  and t1.tagentsid=$tagentsid$
  and $where$