This repository has been archived on 2026-06-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
EDT/dz/dp/detail-标准.php
wsh5485 7e47ce238b chore: 添加多个图片和资源文件
添加了管理后台所需的图片资源、Excel文件、安装程序以及设计相关的图片文件
2025-06-15 13:04:37 +08:00

267 lines
9.6 KiB
PHP

<?php
//-------------------------------------------------------店铺界面,订单明细
$s_order=$s_order?$s_order:"date";
$detail_size_ms=get_set("detail_size_ms");
//-------------------处理尺码表头
//取得合并尺码
$arr_size_merged=get_size_merged();
$num_size_total=count($arr_size_merged);
//取得尺码合计sql
$sql_sum_num="";
for($k=0;$k<$num_size_total;$k++){
$sql_sum_num.="sum(num_".$arr_size_merged[$k].") 'num_".$arr_size_merged[$k]."',";
}
//取得尺码表头内容
$num_size_group=0;
$size_tr=array();
$r1=$db->query("select * from ".$table_pre."keyword where cate='size' order by ord");
while($m1=$db->fetch_array($r1)){
$size_tr[$num_size_group]="";
for($i=1;$i<=$num_size_total;$i++){
$tmp=get_db_msg("select title from ".$table_pre."size where iid='".$m1["id"]."' and no='".$i."'");
$t=$tmp["title"]?$tmp["title"]:"&nbsp;";
$size_tr[$num_size_group].="\"w:30 a:c|".$t."\",";
}
$arr_size_merged[]=$m1["no"];
$num_size_group++;
}
//-------------------/处理尺码表头结束
$i1=0;
//买断款过滤
if($check_md["num"]>0){
$search_select_no[$i1]="s_md";
$search_select_op[$i1]=array(""=>"包含买断款","n"=>"非买断款");
$i1++;
}
if($s_md=="y"){
//仅买断款,暂时不做
}else{
//-------------------包含买断款、非买断款
//删除款过滤
$search_select_no[$i1]="s_ka";
$search_select_op[$i1]=array("n"=>"非删除款","y"=>"删除款");
$i1++;
//饰品款过滤
if($is_spk=="y"){
$search_select_no[$i1]="s_is_sp";
$search_select_op[$i1]=array(""=>"".d_translate("spk"),"n"=>"不含".d_translate("spk"),"y"=>"".d_translate("spk"));
$i1++;
}
//选项过滤
for($i=0;$i<count($arr_select_no);$i++){
$v="s_".$arr_select_no[$i];
$r1=$db->query("select no,title from ".$table_pre."keyword where cate='".$arr_select_no[$i]."' order by no");
$search_select_no[$i1]=$v;
$search_select_op[$i1][""]=$arr_select_title[$i]."过滤";
while($m1=$db->fetch_array($r1)){
$search_select_op[$i1][$m1["no"]]=$m1["title"];
}
$i1++;
}
//排序
$search_select_no[$i1]="s_order";
$search_select_op[$i1]=array("date"=>"时间排序","num"=>"数量排序");
//----------------------------------------------取得订单记录
//----表头
if($detail_size_ms=="2"){
//重新计算$num_size_total
$num_size_total1=0;
for($k=$num_size_total-1;$k>=0;$k--){
$tmp=get_db_msg("select sum(num_".$arr_size_merged[$k].") 'num' from ".$table_pre."order where _key='".$s_key."' ".$con);
if($tmp["num"]>0){
$num_size_total1=$k+1;
break;
}
}
$num_size_total=$num_size_total1;
//
$content_thead[0]="\"w:40|次序\",\"款号\",";
for($i=0;$i<count($sys_detail_show_select);$i++){
$content_thead[0].="|".get_cate_title_no("arr_select",$sys_detail_show_select[$i])."\",";
}
$content_thead[0].="\"颜色\",";
if($bx_sizegroup_id>0)
$content_thead[0].="\"w:30|杯型\",";
if($is_gg=="y")
$content_thead[0].="\"w:50|".d_translate("gg")."\",\"rs:".$num_size_group." w:50|".get_main_value($sys_gg_zd,"price")."\",";
else if($is_gg=="b")
$content_thead[0].="\"w:50|".d_translate("gg")."\",";
$content_thead[0].="\"cs:".$num_size_total."|尺码明细\",\"w:35|小计\",";
if($is_gg!="y")
$content_thead[0].="\"w:50|".d_translate("dpj")."\",";
$content_thead[0].="\"w:60|".d_translate("dpje")."\",";
if(trim($zk_type) || $check_md["num"]>0)
$content_thead[0].="\"w:60|结算金额\",";
}else{
$content_thead[0]="\"rs:".$num_size_group." w:40|次序\",\"rs:".$num_size_group."|款号\",";
for($i=0;$i<count($sys_detail_show_select);$i++){
$content_thead[0].="\"rs:".$num_size_group."|".get_cate_title_no("arr_select",$sys_detail_show_select[$i])."\",";
}
$content_thead[0].="\"rs:".$num_size_group."|颜色\",";
if($bx_sizegroup_id>0)
$content_thead[0].="\"rs:".$num_size_group." w:30|杯型\",";
if($is_gg=="y")
$content_thead[0].="\"rs:".$num_size_group." w:50|".d_translate("gg")."\",\"rs:".$num_size_group." w:50|".get_main_value($sys_gg_zd,"price")."\",";
else if($is_gg=="b")
$content_thead[0].="\"rs:".$num_size_group." w:50|".d_translate("gg")."\",";
$content_thead[0].=$size_tr[0]."\"rs:".$num_size_group." w:35|小计\",";
if($is_gg!="y")
$content_thead[0].="\"rs:".$num_size_group." w:50|".d_translate("dpj")."\",";
$content_thead[0].="\"rs:".$num_size_group." w:60|".d_translate("dpje")."\",";
if(trim($zk_type) || $check_md["num"]>0)
$content_thead[0].="\"rs:".$num_size_group." w:60|结算金额\",";
for($i=1;$i<$num_size_group;$i++){
$content_thead[$i].=$size_tr[$i];
}
}
//----表头完成
$con_order="";
if($s_order=="date"){
$con_order=" add_date desc";
}else if($s_order=="num"){
$con_order=" num desc,no";
}else if($s_order=="je"){
$con_order=" je desc,no";
}
$q="select iid,no,sum(num) 'num',sum(num) 'num1',price from ".$table_pre."order where _key='".$s_key."'".$con." group by no order by ".$con_order;
//echo $q."<br>";
$r=$db->query($q);
$total_num=$total_money=$total_money_zk=0;
$count=0;
$arr_kh=$arr_kh_color=array();
while($m=$db->fetch_array($r)){
$bg=($count%2)?"td1":"td2";
$m1=get_db_msg("select * from ".$table_pre."kh where id='".$m["iid"]."'");
//取得颜色,杯型
$q2="select * from ".$table_pre."order where _key='".$s_key."'".$con." and no='".$m["no"]."' order by color,bx";
//echo $q2."<br>";
$r2=$db->query($q2);
//
$j=0;
$je1=$jsje1=$num1=$price1=0;
while($m2=$db->fetch_array($r2)){
$td_size1="";
$num_color_hj=0;
for($k=0;$k<$num_size_total;$k++){
$ck_md=check_md($m1["no"],$m2["color"],$m2["bx"],$arr_size_merged[$k],$msg_login["dj"]);
if($s_md=="n"){
if($ck_md!="n"){
$tmp_num=0;
}else{
$tmp_num=$m2["num_".$arr_size_merged[$k]];
}
}else{
$tmp_num=$m2["num_".$arr_size_merged[$k]];
}
if($ck_md!="n"){
$sty1="bc#90";
}else{
$sty1="";
}
$num1+=$tmp_num;
$num_color_hj+=$tmp_num;
//计算尺码合计
$v11="hj_num_".$k;
$$v11+=$tmp_num;
//
$tmp1=($sty1=="bc#90")?"st:".$sty1:"c:".$bg;
if($tmp_num>0){
if($detail_size_ms=="2"){
$tmp3=get_db_msg("select title from ".$table_pre."size where iid='".$m2["size_group_id"]."' and no='".$arr_size_merged[$k]."'");
$td_size1.="\"".$tmp1." a:r|".$tmp3["title"]."<br>".deel_0($tmp_num)."\",";
}else{
$td_size1.="\"".$tmp1." a:r|".deel_0($tmp_num)."\",";
}
}else{
$td_size1.="\"".$tmp1."| \",";
}
}
$je1+=$m2["je"];
$jsje1+=$m2["jsje"];
$price1+=$m2["price"];
if($num_color_hj>0){
$arr_kh_color[$count][$j]="\"c:".$bg."|".$m2["color"]."-".get_cate_title_no("color",$m2["color"])."\",";
if($bx_sizegroup_id>0)
$arr_kh_color[$count][$j].="\"c:".$bg."|".$m2["bx"]."\",";
if($is_gg=="y"){
$tmp=get_db_msg("select price from ".$table_pre."kh_gg where iid='".$m2["iid"]."' and color='".$m2["color"]."' and gg='".$m2["bx"]."'");
$arr_kh_color[$count][$j].="\"c:".$bg." a:c|".get_gg_title($m2["bx"])."\",\"c:".$bg." a:r|".$tmp["price"]."\",";
}else if($is_gg=="b"){
$arr_kh_color[$count][$j].="\"c:".$bg." a:c|".get_gg_title($m2["bx"])."\",";
}
$arr_kh_color[$count][$j].=$td_size1;
$j++;
}
}
$total_num+=$num1;
$total_money+=$je1;
$total_money_zk+=$jsje1;
//
if($num1>0){
$arr_kh[$count]["bg"]=$bg;
$arr_kh[$count]["id"]=$m1["id"];
$arr_kh[$count]["no"]=$m1["no"];
for($i1=0;$i1<count($sys_detail_show_select);$i1++){
$arr_kh[$count][$sys_detail_show_select[$i1]]=get_cate_title_no($sys_detail_show_select[$i1],$m1[$sys_detail_show_select[$i1]]);
}
$xh=get_kh_xh($m1);
$xh=$xh>0?$xh."#":"";
$arr_kh[$count]["xh"]=$xh;
$arr_kh[$count]["num"]=$num1;
$arr_kh[$count]["price"]=deel_num(keep_float($price1/$j,2));
$arr_kh[$count]["je"]=$je1;
$arr_kh[$count]["jsje"]=$jsje1;
$count++;
}
}
//组合输出内容
$total_kss=0;
for($i=0;$i<count($arr_kh);$i++){
$list=$i+1;
$num1=count($arr_kh_color[$i]);
for($j=0;$j<$num1;$j++){
if($j==0){
$tmp_str=($num1==1)?"":"rs:".$num1."";
$content_tbody[$total_kss]="\"".$tmp_str." c:".$arr_kh[$i]["bg"]."|".$list."\",\"".$tmp_str." c:".$arr_kh[$i]["bg"]."|".$arr_kh[$i]["id"]."l1&".$arr_kh[$i]["xh"].$arr_kh[$i]["no"]."\",";
for($i1=0;$i1<count($sys_detail_show_select);$i1++){
$content_tbody[$total_kss].="\"".$tmp_str." c:".$arr_kh[$i]["bg"]."|".$arr_kh[$i][$sys_detail_show_select[$i1]]."\",";
}
$content_tbody[$total_kss].=$arr_kh_color[$i][$j]."\"".$tmp_str." c:".$arr_kh[$i]["bg"]." a:r|".$arr_kh[$i]["num"]."\",";
if($is_gg!="y")
$content_tbody[$total_kss].="\"".$tmp_str." c:".$arr_kh[$i]["bg"]." a:r|".$arr_kh[$i]["price"]."\",";
$content_tbody[$total_kss].="\"".$tmp_str." c:".$arr_kh[$i]["bg"]." a:r|".($arr_kh[$i]["je"])."\",";
if(trim($zk_type) || $check_md["num"]>0)
$content_tbody[$total_kss].="\"".$tmp_str." c:".$arr_kh[$i]["bg"]." a:r|".deel_num(keep_float($arr_kh[$i]["jsje"],2))."\",";
}else{
$content_tbody[$total_kss]=$arr_kh_color[$i][$j];
}
$total_kss++;
}
}
$td_size1="";
for($k=0;$k<$num_size_total;$k++){
$v1="hj_num_".$k;
$td_size1.="\"c:td3 a:r|".deel_td($$v1)."\",";
}
$price_pj=($total_num>0)?keep_float($total_money/$total_num,2):0;
$hj_colspan=($bx_sizegroup_id>0)?4:3;
if($is_gg=="y")
$hj_colspan+=2;
else if($is_gg=="b")
$hj_colspan+=1;
$hj_colspan+=count($sys_detail_show_select);
$content_tbody[$total_kss]="\"c:td3 cs:".$hj_colspan." a:r|合计\",".$td_size1."\"c:td3 a:r|".$total_num."\",";
if($is_gg!="y")
$content_tbody[$total_kss].="\"c:td3 a:r|".$price_pj."\",";
$content_tbody[$total_kss].="\"c:td3 a:r|".$total_money."\",";
if(trim($zk_type) || $check_md["num"]>0){
$content_tbody[$total_kss].="\"c:td3 a:r|".deel_num(keep_float($total_money_zk,2))."\",";
}
}
$js_body="$(function () { $(\".fix1\").fixedtableheader({headerrowsize:".count($size_tr)."}); });";
$bb_title="订单明细";
include template("order_list_js");
$db->close();
exit;
?>