0){ $arr_group_by["9"]=d_translate("qy"); $default_group_by="9"; } $tmp=get_db_msg("select count(*) 'num' from ".$table_pre."client where face=3"); if($tmp["num"]>0){ $arr_group_by["3"]=d_translate("dl"); $default_group_by="3"; } $default_group_by=$default_group_by?$default_group_by:"4"; $arr_group_by["4"]="客户"; $arr_group_by["1"]="明细"; $s_group_by=$s_group_by?$s_group_by:$default_group_by; $msg=get_db_msg("select * from ".$table_pre."kh where no='".$kh."'"); if($color){ $pic=get_kh_color_picture($kh,$color); }else{ $pic=get_kh_picture($msg["no"],$msg["main_pic"],$msg["color"]); } $arr_pic_set=out_good_pic_set_arr($pic,200,200); $json_data.="\"kh\":\"".$msg["no"]."\","; $json_data.="\"color\":\"".$color."\","; $json_data.="\"pic\":\"".$pic."\","; $json_data.="\"pic_w\":\"".$arr_pic_set[0]."\","; $json_data.="\"pic_h\":\"".$arr_pic_set[1]."\","; $str_group_by=""; foreach($arr_group_by as $k1 => $v1){ $str_group_by.="{"; $str_group_by.="\"group_by_no\":\"".$k1."\","; $str_group_by.="\"group_by_title\":\"".$v1."\","; if($s_group_by==$k1){ $str_group_by.="\"group_by_sign\":\"y\""; }else{ $str_group_by.="\"group_by_sign\":\"n\""; } $str_group_by.="},"; } $json_data.="\"group_by\":[".substr($str_group_by,0,-1)."],"; $sql_con="no='".$kh."' and "; if($color) $sql_con.="color='".$color."' and "; $sql_con=substr($sql_con,0,-4); if($s_group_by=="1"){ $thead_str=""; $thead_str.="{\"zd\":\"client\",\"title\":\"客户\"},"; $thead_str.="{\"zd\":\"kh\",\"title\":\"款号\"},"; $thead_str.="{\"zd\":\"color\",\"title\":\"颜色\"},"; if($bx_sizegroup_id==$msg["size_group"]){ $thead_str.="{\"zd\":\"bx\",\"title\":\"杯型\"},"; // $size_str=""; $r1=$db->query("select * from ".$table_pre."size where iid='".$msg["size_group"]."' order by no"); while($m1=$db->fetch_array($r1)){ $size_str.=$m1["no"].","; } if($size_str) $size_str=substr($size_str,0,-1); $size=explode(",",$size_str); }else{ $size=explode(",",$msg["size"]); } $tmp1=explode(",",$msg["color"]); for($l=0;$lquery($q); $hj=0; while($m=$db->fetch_array($r)){ $tmp=get_db_msg("select username,title from ".$table_pre."client where id='".$m["uid"]."'"); $m_kh=get_db_msg("select no from ".$table_pre."kh where id='".$m["iid"]."'"); $tbody_str.="{"; $tbody_str.="\"client\":\"".$tmp["title"]."(".$tmp["username"].")\","; $tbody_str.="\"kh\":\"".$m_kh["no"]."\","; $tbody_str.="\"color\":\"".$m["color"]."-".get_cate_title_no("color",$m["color"])."\","; if($bx_sizegroup_id==$msg["size_group"]) $tbody_str.="\"bx\":\"".$m["bx"]."\","; //尺码列表 $xj=0; for($l=0;$l"加量","22"=>"减量","24"=>"删单"); //取得数组 $arr1=array(); $q="select * from ".$table_pre."client where face='".$s_group_by."'"; $r=$db->query($q); while($m=$db->fetch_array($r)){ if($s_group_by=="4"){ $tmp_sql=" and uid='".$m["id"]."'"; }else{ $p=$m["path"]."-".$m["id"]; $tmp_sql=" and upath like '".$p."-%'"; } $tmp=get_db_msg("select sum(".get_size_sql("sum").") 'num' from ".$table_pre."order where ".$sql_con.$tmp_sql.$con_f); //if($tmp["num"]>0) $arr1[$m["id"]]=$tmp["num"]; } arsort($arr1); if($bx_sizegroup_id==$msg["size_group"]){ // $size_str=""; $r1=$db->query("select * from ".$table_pre."size where iid='".$msg["size_group"]."' order by no"); while($m1=$db->fetch_array($r1)){ $size_str.=$m1["no"].","; } if($size_str) $size_str=substr($size_str,0,-1); $size=explode(",",$size_str); }else{ $size=explode(",",$msg["size"]); } $thead_str=""; $thead_str.="{\"zd\":\"ct\",\"title\":\"序号\"},"; $thead_str.="{\"zd\":\"client\",\"title\":\"客户\"},"; if($s_group_by=="4"){ foreach($arr_show_log_hd as $k1 => $v1){ $thead_str.="{\"zd\":\"zd_".$k1."\",\"title\":\"".$v1."
次数\"},"; } } for($l=0;$l $num1){ $hj+=$num1; $m=get_db_msg("select * from ".$table_pre."client where id='".$id1."'"); if($s_group_by=="4"){ $tmp_sql=" and uid='".$m["id"]."'"; }else{ $p=$m["path"]."-".$m["id"]; $tmp_sql=" and (upath='".$p."' or upath like '".$p."-%')"; } $tmp=get_db_msg("select ".get_size_sql("sum1")." from ".$table_pre."order where ".$sql_con.$tmp_sql.$con_f); $tbody_str.="{"; $tbody_str.="\"ct\":\"".$list."\","; $tbody_str.="\"client\":\"".$m["title"]."(".$m["username"].")\","; if($s_group_by=="4"){ foreach($arr_show_log_hd as $k1 => $v1){ //加单次数 $t1=get_db_msg("select count(*) 'num' from ".$table_pre."log_hd where uid='".$m["id"]."' and iid='".$msg["id"]."' and action='".$k1."'"); $tbody_str.="\"zd_".$k1."\":\"".deel_0($t1["num"])."\","; $v1="hj_action_".$k1; $$v1+=$t1["num"]; } } for($l=0;$l $v1){ $v1="hj_action_".$k1; $json_data.="\"zd_".$k1."\":\"".$$v1."\","; } } for($l=0;$l $v1){ $str_group_by.="{"; $str_group_by.="\"group_by_no\":\"".$k1."\","; $str_group_by.="\"group_by_title\":\"".$v1."\","; if($s_group_by==$k1){ $str_group_by.="\"group_by_sign\":\"y\""; }else{ $str_group_by.="\"group_by_sign\":\"n\""; } $str_group_by.="},"; } $json_data.="\"group_by\":[".substr($str_group_by,0,-1)."],"; $sql_con="and no='".$kh."' and "; if($color) $sql_con.="color='".$color."' and "; $sql_con=substr($sql_con,0,-4); if($s_group_by=="1"){ $thead_str=""; $thead_str.="{\"zd\":\"client\",\"title\":\"客户\"},"; $thead_str.="{\"zd\":\"kh\",\"title\":\"款号\"},"; $thead_str.="{\"zd\":\"color\",\"title\":\"颜色\"},"; if($bx_sizegroup_id==$msg["size_group"]){ $thead_str.="{\"zd\":\"bx\",\"title\":\"杯型\"},"; // $size_str=""; $r1=$db->query("select * from ".$table_pre."size where iid='".$msg["size_group"]."' order by no"); while($m1=$db->fetch_array($r1)){ $size_str.=$m1["no"].","; } if($size_str) $size_str=substr($size_str,0,-1); $size=explode(",",$size_str); }else{ $size=explode(",",$msg["size"]); } $tmp1=explode(",",$msg["color"]); for($l=0;$l'0'".$sql_con."".$sql_con_u.$con_f." order by uid,add_date"; $r=$db->query($q); $hj=0; while($m=$db->fetch_array($r)){ $tmp=get_db_msg("select username,title from ".$table_pre."client where id='".$m["uid"]."'"); $m_kh=get_db_msg("select no from ".$table_pre."kh where id='".$m["iid"]."'"); $tbody_str.="{"; $tbody_str.="\"client\":\"".$tmp["title"]."(".$tmp["username"].")\","; $tbody_str.="\"kh\":\"".$m_kh["no"]."\","; $tbody_str.="\"color\":\"".$m["color"]."-".get_cate_title_no("color",$m["color"])."\","; if($bx_sizegroup_id==$msg["size_group"]) $tbody_str.="\"bx\":\"".$m["bx"]."\","; //尺码列表 $xj=0; for($l=0;$l"加量","22"=>"减量","24"=>"删单"); //取得数组 $arr1=array(); $q="select * from (select id,face,concat(path,'-',id) 'upath' from ".$table_pre."client where face='4') a where a.id>0 ".$sql_con_u; $r=$db->query($q); while($m=$db->fetch_array($r)){ if($s_group_by=="4"){ $tmp_sql=" and uid='".$m["id"]."'"; }else{ $p=$m["path"]."-".$m["id"]; $tmp_sql=" and upath like '".$p."-%'"; } $tmp=get_db_msg("select sum(".get_size_sql("sum").") 'num' from ".$table_pre."order where id>'0' ".$sql_con.$tmp_sql.$con_f); //if($tmp["num"]>0) $arr1[$m["id"]]=$tmp["num"]; } arsort($arr1); if($bx_sizegroup_id==$msg["size_group"]){ // $size_str=""; $r1=$db->query("select * from ".$table_pre."size where iid='".$msg["size_group"]."' order by no"); while($m1=$db->fetch_array($r1)){ $size_str.=$m1["no"].","; } if($size_str) $size_str=substr($size_str,0,-1); $size=explode(",",$size_str); }else{ $size=explode(",",$msg["size"]); } $thead_str=""; $thead_str.="{\"zd\":\"ct\",\"title\":\"序号\"},"; $thead_str.="{\"zd\":\"client\",\"title\":\"客户\"},"; if($s_group_by=="4"){ foreach($arr_show_log_hd as $k1 => $v1){ $thead_str.="{\"zd\":\"zd_".$k1."\",\"title\":\"".$v1."
次数\"},"; } } for($l=0;$l $num1){ $hj+=$num1; $m=get_db_msg("select * from ".$table_pre."client where id='".$id1."'"); if($s_group_by=="4"){ $tmp_sql=" and uid='".$m["id"]."'"; }else{ $p=$m["path"]."-".$m["id"]; $tmp_sql=" and (upath='".$p."' or upath like '".$p."-%')"; } $tmp=get_db_msg("select ".get_size_sql("sum1")." from ".$table_pre."order where id>'0' ".$sql_con.$tmp_sql.$con_f); $tbody_str.="{"; $tbody_str.="\"ct\":\"".$list."\","; $tbody_str.="\"client\":\"".$m["title"]."(".$m["username"].")\","; if($s_group_by=="4"){ foreach($arr_show_log_hd as $k1 => $v1){ //加单次数 $t1=get_db_msg("select count(*) 'num' from ".$table_pre."log_hd where uid='".$m["id"]."' and iid='".$msg["id"]."' and action='".$k1."'"); $tbody_str.="\"zd_".$k1."\":\"".deel_0($t1["num"])."\","; $v1="hj_action_".$k1; $$v1+=$t1["num"]; } } for($l=0;$l $v1){ $v1="hj_action_".$k1; $json_data.="\"zd_".$k1."\":\"".$$v1."\","; } } for($l=0;$l $v1){ $str_group_by.="{"; $str_group_by.="\"group_by_no\":\"".$k1."\","; $str_group_by.="\"group_by_title\":\"".$v1."\","; if($s_group_by==$k1){ $str_group_by.="\"group_by_sign\":\"y\""; }else{ $str_group_by.="\"group_by_sign\":\"n\""; } $str_group_by.="},"; } $json_data.="\"group_by\":[".substr($str_group_by,0,-1)."],"; $sql_con=" and no='".$kh."' and "; if($color) $sql_con.="color='".$color."' and "; $sql_con=substr($sql_con,0,-4); if($s_group_by=="1"){ $thead_str=""; $thead_str.="{\"zd\":\"client\",\"title\":\"客户\"},"; $thead_str.="{\"zd\":\"kh\",\"title\":\"款号\"},"; $thead_str.="{\"zd\":\"color\",\"title\":\"颜色\"},"; if($bx_sizegroup_id==$msg["size_group"]){ $thead_str.="{\"zd\":\"bx\",\"title\":\"杯型\"},"; // $size_str=""; $r1=$db->query("select * from ".$table_pre."size where iid='".$msg["size_group"]."' order by no"); while($m1=$db->fetch_array($r1)){ $size_str.=$m1["no"].","; } if($size_str) $size_str=substr($size_str,0,-1); $size=explode(",",$size_str); }else{ $size=explode(",",$msg["size"]); } $tmp1=explode(",",$msg["color"]); for($l=0;$l'0' ".$sql_con."".$sql_con_u.$con_f." order by uid,add_date"; $r=$db->query($q); $hj=0; while($m=$db->fetch_array($r)){ $tmp=get_db_msg("select username,title from ".$table_pre."client where id='".$m["uid"]."'"); $m_kh=get_db_msg("select no from ".$table_pre."kh where id='".$m["iid"]."'"); $tbody_str.="{"; $tbody_str.="\"client\":\"".$tmp["title"]."(".$tmp["username"].")\","; $tbody_str.="\"kh\":\"".$m_kh["no"]."\","; $tbody_str.="\"color\":\"".$m["color"]."-".get_cate_title_no("color",$m["color"])."\","; if($bx_sizegroup_id==$msg["size_group"]) $tbody_str.="\"bx\":\"".$m["bx"]."\","; //尺码列表 $xj=0; for($l=0;$l"加量","22"=>"减量","24"=>"删单"); //取得数组 $arr1=array(); $q="select * from (select id,face,concat(path,'-',id) 'upath' from ".$table_pre."client where face='4') a where a.id>0 ".$sql_con_u; $r=$db->query($q); while($m=$db->fetch_array($r)){ if($s_group_by=="4"){ $tmp_sql=" and uid='".$m["id"]."'"; }else{ $p=$m["path"]."-".$m["id"]; $tmp_sql=" and upath like '".$p."-%'"; } $tmp=get_db_msg("select sum(".get_size_sql("sum").") 'num' from ".$table_pre."order where id>0 ".$sql_con.$tmp_sql.$con_f); //if($tmp["num"]>0) $arr1[$m["id"]]=$tmp["num"]; } arsort($arr1); if($bx_sizegroup_id==$msg["size_group"]){ // $size_str=""; $r1=$db->query("select * from ".$table_pre."size where iid='".$msg["size_group"]."' order by no"); while($m1=$db->fetch_array($r1)){ $size_str.=$m1["no"].","; } if($size_str) $size_str=substr($size_str,0,-1); $size=explode(",",$size_str); }else{ $size=explode(",",$msg["size"]); } $thead_str=""; $thead_str.="{\"zd\":\"ct\",\"title\":\"序号\"},"; $thead_str.="{\"zd\":\"client\",\"title\":\"客户\"},"; if($s_group_by=="4"){ foreach($arr_show_log_hd as $k1 => $v1){ $thead_str.="{\"zd\":\"zd_".$k1."\",\"title\":\"".$v1."
次数\"},"; } } for($l=0;$l $num1){ $hj+=$num1; $m=get_db_msg("select * from ".$table_pre."client where id='".$id1."'"); if($s_group_by=="4"){ $tmp_sql=" and uid='".$m["id"]."'"; }else{ $p=$m["path"]."-".$m["id"]; $tmp_sql=" and (upath='".$p."' or upath like '".$p."-%')"; } $tmp=get_db_msg("select ".get_size_sql("sum1")." from ".$table_pre."order where id>'0' ".$sql_con.$tmp_sql.$con_f); $tbody_str.="{"; $tbody_str.="\"ct\":\"".$list."\","; $tbody_str.="\"client\":\"".$m["title"]."(".$m["username"].")\","; if($s_group_by=="4"){ foreach($arr_show_log_hd as $k1 => $v1){ //加单次数 $t1=get_db_msg("select count(*) 'num' from ".$table_pre."log_hd where uid='".$m["id"]."' and iid='".$msg["id"]."' and action='".$k1."'"); $tbody_str.="\"zd_".$k1."\":\"".deel_0($t1["num"])."\","; $v1="hj_action_".$k1; $$v1+=$t1["num"]; } } for($l=0;$l $v1){ $v1="hj_action_".$k1; $json_data.="\"zd_".$k1."\":\"".$$v1."\","; } } for($l=0;$l0){ $arr_group_by["9"]=d_translate("qy"); $default_group_by="9"; } $tmp=get_db_msg("select count(*) 'num' from ".$table_pre."client where face=3"); if($tmp["num"]>0){ $arr_group_by["3"]=d_translate("dl"); $default_group_by="3"; } $default_group_by=$default_group_by?$default_group_by:"4"; $arr_group_by["4"]="客户"; $arr_group_by["1"]="明细"; $s_group_by=$s_group_by?$s_group_by:$default_group_by; $msg=get_db_msg("select * from ".$table_pre."kh where no='".$kh."'"); if($color){ $pic=get_kh_color_picture($kh,$color); }else{ $pic=get_kh_picture($msg["no"],$msg["main_pic"],$msg["color"]); } $arr_pic_set=out_good_pic_set_arr($pic,200,200); $json_data.="\"kh\":\"".$msg["no"]."\","; $json_data.="\"color\":\"".$color."\","; $json_data.="\"pic\":\"".$pic."\","; $json_data.="\"pic_w\":\"".$arr_pic_set[0]."\","; $json_data.="\"pic_h\":\"".$arr_pic_set[1]."\","; $str_group_by=""; foreach($arr_group_by as $k1 => $v1){ $str_group_by.="{"; $str_group_by.="\"group_by_no\":\"".$k1."\","; $str_group_by.="\"group_by_title\":\"".$v1."\","; if($s_group_by==$k1){ $str_group_by.="\"group_by_sign\":\"y\""; }else{ $str_group_by.="\"group_by_sign\":\"n\""; } $str_group_by.="},"; } $json_data.="\"group_by\":[".substr($str_group_by,0,-1)."],"; $sql_con="no='".$kh."' and "; if($color) $sql_con.="color='".$color."' and "; $sql_con=substr($sql_con,0,-4); if($s_group_by=="1"){ $thead_str=""; $thead_str.="{\"zd\":\"client\",\"title\":\"客户\"},"; $thead_str.="{\"zd\":\"kh\",\"title\":\"款号\"},"; $thead_str.="{\"zd\":\"color\",\"title\":\"颜色\"},"; if($bx_sizegroup_id==$msg["size_group"]){ $thead_str.="{\"zd\":\"bx\",\"title\":\"杯型\"},"; // $size_str=""; $r1=$db->query("select * from ".$table_pre."size where iid='".$msg["size_group"]."' order by no"); while($m1=$db->fetch_array($r1)){ $size_str.=$m1["no"].","; } if($size_str) $size_str=substr($size_str,0,-1); $size=explode(",",$size_str); }else{ $size=explode(",",$msg["size"]); } $tmp1=explode(",",$msg["color"]); for($l=0;$lquery($q); $hj=0; while($m=$db->fetch_array($r)){ $tmp=get_db_msg("select username,title from ".$table_pre."client where id='".$m["uid"]."'"); $m_kh=get_db_msg("select no from ".$table_pre."kh where id='".$m["iid"]."'"); $tbody_str.="{"; $tbody_str.="\"client\":\"".$tmp["title"]."(".$tmp["username"].")\","; $tbody_str.="\"kh\":\"".$m_kh["no"]."\","; $tbody_str.="\"color\":\"".$m["color"]."-".get_cate_title_no("color",$m["color"])."\","; if($bx_sizegroup_id==$msg["size_group"]) $tbody_str.="\"bx\":\"".$m["bx"]."\","; //尺码列表 $xj=0; for($l=0;$l"加量","22"=>"减量","24"=>"删单"); //取得数组 $arr1=array(); $q="select * from ".$table_pre."client where face='".$s_group_by."'"; $r=$db->query($q); while($m=$db->fetch_array($r)){ if($s_group_by=="4"){ $tmp_sql=" and uid='".$m["id"]."'"; }else{ $p=$m["path"]."-".$m["id"]; $tmp_sql=" and upath like '".$p."-%'"; } $tmp=get_db_msg("select sum(".get_size_sql("sum").") 'num' from ".$table_pre."order where ".$sql_con.$tmp_sql.$con_f); //if($tmp["num"]>0) $arr1[$m["id"]]=$tmp["num"]; } arsort($arr1); if($bx_sizegroup_id==$msg["size_group"]){ // $size_str=""; $r1=$db->query("select * from ".$table_pre."size where iid='".$msg["size_group"]."' order by no"); while($m1=$db->fetch_array($r1)){ $size_str.=$m1["no"].","; } if($size_str) $size_str=substr($size_str,0,-1); $size=explode(",",$size_str); }else{ $size=explode(",",$msg["size"]); } $thead_str=""; $thead_str.="{\"zd\":\"ct\",\"title\":\"序号\"},"; $thead_str.="{\"zd\":\"client\",\"title\":\"客户\"},"; if($s_group_by=="4"){ foreach($arr_show_log_hd as $k1 => $v1){ $thead_str.="{\"zd\":\"zd_".$k1."\",\"title\":\"".$v1."
次数\"},"; } } for($l=0;$l $num1){ $hj+=$num1; $m=get_db_msg("select * from ".$table_pre."client where id='".$id1."'"); if($s_group_by=="4"){ $tmp_sql=" and uid='".$m["id"]."'"; }else{ $p=$m["path"]."-".$m["id"]; $tmp_sql=" and (upath='".$p."' or upath like '".$p."-%')"; } $tmp=get_db_msg("select ".get_size_sql("sum1")." from ".$table_pre."order where ".$sql_con.$tmp_sql.$con_f); $tbody_str.="{"; $tbody_str.="\"ct\":\"".$list."\","; $tbody_str.="\"client\":\"".$m["title"]."(".$m["username"].")\","; if($s_group_by=="4"){ foreach($arr_show_log_hd as $k1 => $v1){ //加单次数 $t1=get_db_msg("select count(*) 'num' from ".$table_pre."log_hd where uid='".$m["id"]."' and iid='".$msg["id"]."' and action='".$k1."'"); $tbody_str.="\"zd_".$k1."\":\"".deel_0($t1["num"])."\","; $v1="hj_action_".$k1; $$v1+=$t1["num"]; } } for($l=0;$l $v1){ $v1="hj_action_".$k1; $json_data.="\"zd_".$k1."\":\"".$$v1."\","; } } for($l=0;$l0){ $arr_group_by["9"]=d_translate("qy"); $default_group_by="9"; } $tmp=get_db_msg("select count(*) 'num' from ".$table_pre."client where face=3"); if($tmp["num"]>0){ $arr_group_by["3"]=d_translate("dl"); $default_group_by="3"; } $default_group_by=$default_group_by?$default_group_by:"4"; $arr_group_by["4"]="客户"; $arr_group_by["1"]="明细"; $s_group_by=$s_group_by?$s_group_by:$default_group_by; $msg=get_db_msg("select * from ".$table_pre."kh where no='".$kh."'"); if($color){ $pic=get_kh_color_picture($kh,$color); }else{ $pic=get_kh_picture($msg["no"],$msg["main_pic"],$msg["color"]); } $arr_pic_set=out_good_pic_set_arr($pic,200,200); $json_data.="\"kh\":\"".$msg["no"]."\","; $json_data.="\"color\":\"".$color."\","; $json_data.="\"pic\":\"".$pic."\","; $json_data.="\"pic_w\":\"".$arr_pic_set[0]."\","; $json_data.="\"pic_h\":\"".$arr_pic_set[1]."\","; $str_group_by=""; foreach($arr_group_by as $k1 => $v1){ $str_group_by.="{"; $str_group_by.="\"group_by_no\":\"".$k1."\","; $str_group_by.="\"group_by_title\":\"".$v1."\","; if($s_group_by==$k1){ $str_group_by.="\"group_by_sign\":\"y\""; }else{ $str_group_by.="\"group_by_sign\":\"n\""; } $str_group_by.="},"; } $json_data.="\"group_by\":[".substr($str_group_by,0,-1)."],"; $sql_con="no='".$kh."' and "; if($color) $sql_con.="color='".$color."' and "; $sql_con=substr($sql_con,0,-4); if($s_group_by=="1"){ $thead_str=""; $thead_str.="{\"zd\":\"client\",\"title\":\"客户\"},"; $thead_str.="{\"zd\":\"kh\",\"title\":\"款号\"},"; $thead_str.="{\"zd\":\"color\",\"title\":\"颜色\"},"; if($bx_sizegroup_id==$msg["size_group"]){ $thead_str.="{\"zd\":\"bx\",\"title\":\"杯型\"},"; // $size_str=""; $r1=$db->query("select * from ".$table_pre."size where iid='".$msg["size_group"]."' order by no"); while($m1=$db->fetch_array($r1)){ $size_str.=$m1["no"].","; } if($size_str) $size_str=substr($size_str,0,-1); $size=explode(",",$size_str); }else{ $size=explode(",",$msg["size"]); } $tmp1=explode(",",$msg["color"]); for($l=0;$lquery($q); $hj=0; while($m=$db->fetch_array($r)){ $tmp=get_db_msg("select username,title from ".$table_pre."client where id='".$m["uid"]."'"); $m_kh=get_db_msg("select no from ".$table_pre."kh where id='".$m["iid"]."'"); $tbody_str.="{"; $tbody_str.="\"client\":\"".$tmp["title"]."(".$tmp["username"].")\","; $tbody_str.="\"kh\":\"".$m_kh["no"]."\","; $tbody_str.="\"color\":\"".$m["color"]."-".get_cate_title_no("color",$m["color"])."\","; if($bx_sizegroup_id==$msg["size_group"]) $tbody_str.="\"bx\":\"".$m["bx"]."\","; //尺码列表 $xj=0; for($l=0;$l"加量","22"=>"减量","24"=>"删单"); //取得数组 $arr1=array(); $q="select * from ".$table_pre."client where face='".$s_group_by."'"; $r=$db->query($q); while($m=$db->fetch_array($r)){ if($s_group_by=="4"){ $tmp_sql=" and uid='".$m["id"]."'"; }else{ $p=$m["path"]."-".$m["id"]; $tmp_sql=" and upath like '".$p."-%'"; } $tmp=get_db_msg("select sum(".get_size_sql("sum").") 'num' from ".$table_pre."order where ".$sql_con.$tmp_sql.$con_f); //if($tmp["num"]>0) $arr1[$m["id"]]=$tmp["num"]; } arsort($arr1); if($bx_sizegroup_id==$msg["size_group"]){ // $size_str=""; $r1=$db->query("select * from ".$table_pre."size where iid='".$msg["size_group"]."' order by no"); while($m1=$db->fetch_array($r1)){ $size_str.=$m1["no"].","; } if($size_str) $size_str=substr($size_str,0,-1); $size=explode(",",$size_str); }else{ $size=explode(",",$msg["size"]); } $thead_str=""; $thead_str.="{\"zd\":\"ct\",\"title\":\"序号\"},"; $thead_str.="{\"zd\":\"client\",\"title\":\"客户\"},"; if($s_group_by=="4"){ foreach($arr_show_log_hd as $k1 => $v1){ $thead_str.="{\"zd\":\"zd_".$k1."\",\"title\":\"".$v1."
次数\"},"; } } for($l=0;$l $num1){ $hj+=$num1; $m=get_db_msg("select * from ".$table_pre."client where id='".$id1."'"); if($s_group_by=="4"){ $tmp_sql=" and uid='".$m["id"]."'"; }else{ $p=$m["path"]."-".$m["id"]; $tmp_sql=" and (upath='".$p."' or upath like '".$p."-%')"; } $tmp=get_db_msg("select ".get_size_sql("sum1")." from ".$table_pre."order where ".$sql_con.$tmp_sql.$con_f); $tbody_str.="{"; $tbody_str.="\"ct\":\"".$list."\","; $tbody_str.="\"client\":\"".$m["title"]."(".$m["username"].")\","; if($s_group_by=="4"){ foreach($arr_show_log_hd as $k1 => $v1){ //加单次数 $t1=get_db_msg("select count(*) 'num' from ".$table_pre."log_hd where uid='".$m["id"]."' and iid='".$msg["id"]."' and action='".$k1."'"); $tbody_str.="\"zd_".$k1."\":\"".deel_0($t1["num"])."\","; $v1="hj_action_".$k1; $$v1+=$t1["num"]; } } for($l=0;$l $v1){ $v1="hj_action_".$k1; $json_data.="\"zd_".$k1."\":\"".$$v1."\","; } } for($l=0;$l