这段代码看了一下午了 看不懂

 $sql ="SELECT sum(if(m.type=1,m.m_value,0)) AS t1_value,sum(if(m.type=2,m.m_value,0)) AS t2_value,sum(if(m.type=3,m.m_value,0)) AS t3_value,sum(if(m.type=4,m.m_value,0)) AS t4_value,sum(if(m.type=5,m.m_value,0)) AS t5_value,sum(if(m.type=6,m.m_value,0)) AS t6_value,sum(if(m.type=1,m.sxf,0)) AS t1_sxf,sum(if(m.type=2,m.sxf,0)) AS t2_sxf,0 AS h_value, 0 AS h_zsjr,0 AS inmoney,0 AS outmoney FROM k_money m left outer join k_user u on m.uid=u.uid where m.status=1 AND u.top_uid=$uid AND m.m_make_time>='$begin_time' AND 'm.m_make_time'<='$end_time'";
            
            $sql    =    "SELECT sum(t1_value) AS t1_value,sum(t2_value) AS t2_value,sum(t3_value) AS t3_value,sum(t4_value) AS t4_value,sum(t5_value) AS t5_value,sum(t6_value) AS t6_value,sum(t1_sxf) AS t1_sxf,sum(t2_sxf) AS t2_sxf,sum(h_value) AS h_value,sum(h_zsjr) AS h_zsjr,sum(inmoney) AS inmoney,sum(outmoney) AS outmoney FROM (";
            //查询存取款记录
            $sql    .=    "SELECT sum(if(m.type=1,m.m_value,0)) AS t1_value,sum(if(m.type=2,m.m_value,0)) AS t2_value,sum(if(m.type=3,m.m_value,0)) AS t3_value,sum(if(m.type=4,m.m_value,0)) AS t4_value,sum(if(m.type=5,m.m_value,0)) AS t5_value,sum(if(m.type=6,m.m_value,0)) AS t6_value,sum(if(m.type=1,m.sxf,0)) AS t1_sxf,sum(if(m.type=2,m.sxf,0)) AS t2_sxf,0 AS h_value, 0 AS h_zsjr,0 AS inmoney,0 AS outmoney FROM k_money m left outer join k_user u on m.uid=u.uid where m.status=1 AND u.top_uid=$uid AND m.m_make_time>='$begin_time' AND m.m_make_time<='$end_time'";
            $sql    .=    " union all ";
            //查询汇款金额
            $sql    .=    "SELECT 0 AS t1_value,0 AS t2_value,0 AS t3_value,0 AS t4_value,0 AS t5_value,0 AS t6_value,0 AS t1_sxf,0 AS t2_sxf,sum(ifnull(h.money,0)) AS h_value,sum(ifnull(h.zsjr,0)) AS h_zsjr,0 AS inmoney,0 AS outmoney FROM huikuan h left outer join k_user u on h.uid=u.uid where h.status=1 AND u.top_uid=$uid AND h.adddate>='$begin_time' AND h.adddate<='$end_time'";
            //查询真人
            $sql    .=    " union all ";
            $sql    .=    "SELECT 0 AS t1_value,0 AS t2_value,0 AS t3_value,0 AS t4_value,0 AS t5_value,0 AS t6_value,0 AS t1_sxf,0 AS t2_sxf,0 AS h_value,0 AS h_zsjr,sum(if(z.type='11',z.old_money,0)) AS inmoney,sum(if(z.type='21',z.new_money,0)) AS outmoney FROM zz_info z left outer join k_user u on z.uid=u.uid where u.top_uid=$uid  AND z.status=1 AND z.actionTime>='strtotime($begin_time)' AND z.actionTime<='strtotime($end_time)'";
            $sql    .=    ")temp";
            // var_dump($sql);
            $query    =    $mysqli->query($sql);
已邀请:

Last

赞同来自: ★天道酬勤☆

建议楼主学去广州学并思学一下php哦,这个哪里有教

马志斌 - 一个走在人生道路中不断奋斗的人

赞同来自:

上面不是有中文注释吗

★天道酬勤☆

赞同来自:

我得看懂这段代码  才能改成我想要拿的数据

qiuyongfei

赞同来自:

头大

要回复问题请先登录注册