{"message":"\r\n \tselect\r\n \t trim(a.shopid) as shopid\r\n \t ,trim(s.shopname) as shopname\r\n \t ,trim(a.c_youngbh) as c_youngbh\r\n \t ,r.n_renw\r\n\t ,a.tcount\r\n\t ,a.tmoney\r\n\t ,a.tmoney1\r\n\t ,a.profit\r\n\t ,b.xianj\r\n\t ,b.yinglk\r\n\t ,b.prfmoney\r\n\t ,b.f_baol\r\n\t ,b.chuzk_sc\r\n\t ,b.chuzk_zs\r\n\t ,round((case COALESCE(r.n_renw, 0) when 0 then 0 else a.tcount\/r.n_renw end) * 100,2) as f_wancbl\r\n\t ,round((case when COALESCE(c.ttlqty, 0)<0.00001 then 0 else (a.tcount*100.00)\/c.ttlqty end),2) as percount\r\n\t ,round((case when COALESCE(c.ttlmoney, 0)<0.00001 then 0 else (a.tmoney1*100.00)\/c.ttlmoney end),2) as permoney\r\n\tfrom (\r\n\t\tselect a.shopid,a.c_youngbh,sum(a.amount) as tcount,sum(a.sale) as tmoney,sum(a.sale1) as tmoney1,sum(a.profit) as profit\r\n\t\tfrom (\r\n\t\t\tselect m.scripno,m.gfrom as shopid,z.c_youngbh,m.iodate,m.ioflag,m.iotype,d.code,sp.codename,\r\n\t\t\t d.colorid,c.colorname,d.c_buh,d.xsize, COALESCE(sp.sizegrpid, '1') as sizegrpid,\r\n\t\t\t rs.sizetext,d.price,d.rebate\r\n\t\t\t ,round((CASE WHEN ((abs(d.amount)<=0) or (f.ygnum<=0)) then 0 else d.amount*1.0\/f.ygnum end),0) as amount\r\n\t\t\t ,round((CASE WHEN ((abs(to_number(d.c_yuanbh, '99999999.99'))<=0) or (f.ygnum<=0)) then 0 else to_number(d.c_yuanbh, '99999999.99')\/f.ygnum end),2) as sale\r\n\t\t\t ,round((CASE WHEN ((abs(d.sale)<=0) or (f.ygnum<=0)) then 0 else d.sale\/f.ygnum end),2) as sale1\r\n\t\t\t ,round((CASE WHEN ((abs(d.sale)<=0) or (f.ygnum<=0)) then 0 else (d.sale-d.amount*sp.sale1)\/f.ygnum end),2) as profit\r\n\t\t\tfrom g_inouttbl_zmd m\r\n\t\t\tinner join g_iodetail_zmd d on m.scripno=d.scripno\r\n\t\t\tleft join g_spdm sp on sp.code=d.code\r\n\t\t\tleft join r_size rs on d.xsize=rs.sizeno and COALESCE(sp.sizegrpid, '1')=rs.groupno\r\n\t\t\tleft join colortbl c on c.colorid=d.colorid\r\n\t\t\tleft join g_zmd_sell z on z.scripno=m.scripno\r\n\t\t\tleft join (\r\n\t\t\t\tselect m.scripno,count(z.scripno) as ygnum\r\n\t\t\t\tfrom g_inouttbl_zmd m\r\n\t\t\t\tleft join g_zmd_sell z on z.scripno=m.scripno\r\n\t\t\t\twhere m.ioflag=6 and m.iotype=1\r\n\t\t\t\tand m.gfrom in ('44011103')\r\n\t\t\t\tand m.iodate>='20250501' and m.iodate<='20250526'\r\n\t\t\t\tgroup by m.scripno\r\n\t\t\t) f on m.scripno=f.scripno\r\n\t\t\twhere m.ioflag=6 and m.iotype=1\r\n\t\t\tand m.gfrom in ('44011103')\r\n\t\t\tand m.iodate>='20250501' and m.iodate<='20250526'\r\n\t\t\tand d.rebate>=0 and d.rebate<=100\r\n\t\t) a\r\n\t\tgroup by a.shopid,a.c_youngbh\r\n\t) a\r\n\tleft join (\r\n\t\tselect m.gfrom as shopid,z.c_youngbh\r\n\t\t ,sum(round((CASE WHEN ((abs(m.f_xianj)<=0) or (f.ygnum<=0)) then 0 else m.f_xianj\/f.ygnum end),2)) as xianj\r\n\t\t ,sum(round((CASE WHEN ((abs(m.f_suak)<=0) or (f.ygnum<=0)) then 0 else m.f_suak\/f.ygnum end),2)) as yinglk\r\n\t\t ,sum(round((CASE WHEN ((abs(m.prfmoney)<=0) or (f.ygnum<=0)) then 0 else m.prfmoney\/f.ygnum end),2)) as prfmoney\r\n\t\t ,sum(round((CASE WHEN ((abs(m.f_baol)<=0) or (f.ygnum<=0)) then 0 else m.f_baol\/f.ygnum end),2)) as f_baol\r\n\t\t ,sum(round((CASE WHEN ((abs(sc.chuzk_sc)<=0) or (f.ygnum<=0)) then 0 else sc.chuzk_sc\/f.ygnum end),2)) as chuzk_sc\r\n\t\t ,sum(round((CASE WHEN ((abs(zs.chuzk_zs)<=0) or (f.ygnum<=0)) then 0 else zs.chuzk_zs\/f.ygnum end),2)) as chuzk_zs\r\n\t\tfrom (\r\n\t\t\tselect distinct m.scripno,m.gfrom,m.f_xianj,m.f_suak,m.prfmoney,m.f_baol\r\n\t\t\tfrom g_inouttbl_zmd m\r\n\t\t\tinner join g_iodetail_zmd d on m.scripno=d.scripno\r\n\t\t\twhere m.ioflag=6 and m.iotype=1\r\n\t\t\tand m.gfrom in ('44011103')\r\n\t\t\tand m.iodate>='20250501' and m.iodate<='20250526'\r\n\t\t\tand d.rebate>=0 and d.rebate<=100\r\n\t\t) m\r\n\t\tleft join g_zmd_sell z on z.scripno=m.scripno\r\n\t\tleft join (\r\n\t\t\tselect m.scripno,count(z.scripno) as ygnum\r\n\t\t\tfrom g_inouttbl_zmd m\r\n\t\t\tleft join g_zmd_sell z on z.scripno=m.scripno\r\n\t\t\twhere m.ioflag=6 and m.iotype=1\r\n\t\t\tand m.gfrom in ('44011103')\r\n\t\t\tand m.iodate>='20250501' and m.iodate<='20250526'\r\n\t\t\tgroup by m.scripno\r\n\t\t) f on m.scripno=f.scripno\r\n\t\tleft join (\r\n\t\t\tselect m.scripno,sum(p.paymoney) as chuzk_sc\r\n\t\t\tfrom g_inouttbl_zmd m, g_zmd_pay p\r\n\t\t\twhere m.scripno=p.scripno\r\n\t\t\tand m.gfrom in ('44011103')\r\n\t\t\tand m.iodate>='20250501' and m.iodate<='20250526'\r\n\t\t\tand p.payname='CZ1'\r\n\t\t\tgroup by m.scripno\r\n\t\t) sc on m.scripno=sc.scripno\r\n\t\tleft join (\r\n\t\t\tselect m.scripno,sum(p.paymoney) as chuzk_zs\r\n\t\t\tfrom g_inouttbl_zmd m, g_zmd_pay p\r\n\t\t\twhere m.scripno=p.scripno\r\n\t\t\tand m.gfrom in ('44011103')\r\n\t\t\tand m.iodate>='20250501' and m.iodate<='20250526'\r\n\t\t\tand p.payname='CZ2'\r\n\t\t\tgroup by m.scripno\r\n\t\t) zs on m.scripno=zs.scripno\r\n\t\tgroup by m.gfrom,z.c_youngbh\r\n\t) b on a.shopid=b.shopid and a.c_youngbh=b.c_youngbh\r\n\tleft join (\r\n\t\tselect trim(m.gfrom) as shopid,sum(d.amount) as ttlqty,sum(d.sale) as ttlmoney\r\n\t\tfrom g_inouttbl_zmd m join g_iodetail_zmd d on m.scripno=d.scripno\r\n\t\twhere m.ioflag=6 and m.iotype=1\r\n\t\tand m.gfrom in ('44011103')\r\n\t\tand m.iodate>='20250501' and m.iodate<='20250526'\r\n\t\tand d.rebate>=0 and d.rebate<=100\r\n\t\tgroup by m.gfrom\r\n\t) c on a.shopid=c.shopid\r\n\tleft join (\r\n\t\tselect shopid,c_yingyyxm,n_renw from g_renwsd where shopid in ('44011103') and c_yuef='202505' and n_leib=1\r\n\t) r on a.shopid=r.shopid and a.c_youngbh=r.c_yingyyxm\r\n\tleft join s_shopid s on a.shopid=s.shopid\r\n\t--group by a.shopid,s.shopname,a.c_youngbh,c.ttlqty,c.ttlmoney,r.n_renw\r\n\torder by a.shopid,a.c_youngbh","timestamp":"2025-05-26T09:41:57Z","level":"INFO","user":"440111031","ip":"86.142.224.162","user_agent":"PHPRPC 3.0 Client for Delphi","method":"POST","url":"\/bearsoft\/report\/server.php?phprpc_id=Delphi1895750555202505261740280","status":200,"session_id":"j866cib6p3gnfbrhihgppp7s47","request_id":"683437657b5db","duration_ms":1754,"script":"server.php","server":"iZbp1189eloubd975qfp31Z","type":"eb_report_cx_sql_"}