0){ $str=$m["zsh"]."||"; $str.=$m["title"]."||"; $json_data.="\"zsh\":\"".$m["zsh"]."\","; $json_data.="\"title\":\"".$m["title"]."\","; //图片 $pic1=""; if(trim($m["pic"])){ $pic1=get_picture($m["pic"],$flag_pad_offline); //$str.=$pic1."|".str_replace("\"","'",out_good_pic_set($pic1,$tmpl_m5_cl_pic_width,$tmpl_m5_cl_pic_height)); $tmpwh=out_good_pic_set_arr($pic1,$tmpl_m5_cl_pic_width,$tmpl_m5_cl_pic_height); $json_data.="\"pic\":\"".$pic1."\","; $json_data.="\"pic_w\":\"".$tmpwh[0]."\","; $json_data.="\"pic_h\":\"".$tmpwh[1]."\","; }else{ $pic1="images/no_pic_big.png"; $json_data.="\"pic\":\"".$pic1."\","; $json_data.="\"pic_w\":\"".$tmpl_no_pic_width."\","; $json_data.="\"pic_h\":\"".$tmpl_no_pic_height."\","; } $str.="||"; $query="select title,iid,color from ".$table_pre."kh_tb where tid='".$tid."' and zsh='".$m["zsh"]."' order by ord"; //echo $query."
"; $res=$db->query($query); $style_title_color=get_set("style_title_color"); $ka_color=get_set("ka_color"); $str.="var arr_content=["; $str_arr_content=""; while($msg=$db->fetch_array($res)){ $m_kh=get_db_msg("select * from ".$table_pre."kh where id='".$msg["iid"]."'"); if($m_kh["ka"]=="y"){ $c=$ka_color; }else{ $c=get_set_value_dote($style_title_color,$m_kh["kh_dj"]); } if($msg["iid"]>0){ //图片获取规则 if($msg["color"]){ $pic=get_kh_color_picture($m_kh["no"],$msg["color"],$flag_pad_offline); if($face=="qj"){ $tmp=get_db_msg("select sum(num) 'num' from ".$table_pre."order where ka<>'y' and _key='".$_key."' and iid='".$m_kh["id"]."' and color='".$msg["color"]."' ".get_qj_ucon_all_dpid($msg_login["charge_uid"],"")); $n1=deel_num($tmp["num"]); }else{ $n1=deel_num(get_order_num_kh_color($m_kh["id"],$msg["color"])); } }else{ $pic=get_kh_picture($m_kh["no"],$m_kh["main_pic"],$m_kh["color"],$flag_pad_offline); if($face=="qj"){ $tmp=get_db_msg("select sum(num) 'num' from ".$table_pre."order where ka<>'y' and _key='".$_key."' and iid='".$m_kh["id"]."' ".get_qj_ucon_all_dpid($msg_login["charge_uid"],"")); $n1=deel_num($tmp["num"]); }else{ $n1=deel_num(get_order_num_kh($m_kh["id"])); } } //取得评价信息 $tmp=get_db_msg("select id,race,remark from ".$table_pre."client_pj where khid='".$m_kh["id"]."' and cid='".$uid."'"); $pj_race=$tmp["race"]>0?$tmp["race"]:0; $pj_id=$tmp["id"]>0?$tmp["id"]:0; $msg_pj=$pj_id."|".$pj_race."|".deel_js_var($tmp["remark"]); //取得滑动展示信息 $text_main=""; $q="select * from ".$table_pre."keyword where cate='arr_select' and flag_ka='y' and no<>'jgd' and no<>'sx' and no<>'color' order by ord"; $r=$db->query($q); while($m=$db->fetch_array($r)){ if($m["no"]=="zd1" || $m["no"]=="zd2" || $m["no"]=="zd3"){ //$text_main.=$m_kh[$m["no"]].","; $text_main.=",\"".$m["no"]."\":\"".$m_kh[$m["no"]]."\""; }else{ //$text_main.=deel_js_var(get_cate_title_no($m["no"],$m_kh[$m["no"]])).","; $text_main.=",\"".$m["no"]."\":\"".deel_js_var(get_cate_title_no($m["no"],$m_kh[$m["no"]]))."\""; } } //if($text_main) //$text_main=substr($text_main,0,-2); if($m_kh["remark"]!="") $text_main.=",\"remark\":\"".deel_js_var(dhtmlchars($m_kh["remark"]))."\""; //$str.=$m_kh["id"].",\"".get_kh_xh($m_kh,$msg["color"])."\",\"".$m_kh["no"]."|".$msg["color"]."\",".deel_num($m_kh["price"]).",\"".$pic."\",\"".str_replace("\"","'",out_good_pic_set($pic,$w2,$h2))."\",".$n1.",\"".$c."\",\"".$msg_pj."\",\"".$text_main."\","; $clt=""; if($msg["color"]){ $clt=get_cate_title_no("color",$msg["color"]); } $tmpwh=out_good_pic_set_arr($pic,$w2,$h2); $str_arr_content.="{\"khid\":\"".$m_kh["id"]."\",\"kh_dj\":\"".get_cate_title_no("kh_dj",$m_kh["kh_dj"])."\",\"xh\":\"".get_kh_xh($m_kh,$msg["color"])."\",\"kh\":\"".$m_kh["no"]."\",\"color\":\"".$msg["color"]."\",\"colort\":\"".$clt."\",\"price\":\"".deel_num($m_kh["price"])."\",\"pic\":\"".$pic."\",\"pic_w\":\"".$tmpwh[0]."\",\"pic_h\":\"".$tmpwh[1]."\",\"num\":\"".$n1."\",\"style_color\":\"".$c."\",\"xj\":\"".$pj_race."\",\"pjwz\":\"".deel_js_var($tmp["remark"])."\"".$text_main."},"; } } $str_arr_content=substr($str_arr_content,0,-1); $json_data.="\"tss\":[".$str_arr_content."],"; $str.="]"; }else{ $str="0||"; $json_data.="\"code\":0,\"msg\":\"暂无数据\","; } break; default: if($sys_enable_tb=="y"){ //取得默认展厅 $tmp=get_db_msg("select id from ".$table_pre."kh_tb_t limit 0,1"); $s_tid=$s_tid?$s_tid:$tmp["id"]; $json_data.="\"s_tid\":\"".$s_tid."\","; //取得展厅信息 $arr_select_zt=""; $q="select * from ".$table_pre."kh_tb_t"; $r=$db->query($q); while($m=$db->fetch_array($r)){ //$arr_select_zt.="\"".$m["id"]."|".$m["title"]."\","; $arr_select_zt.="{\"id\":\"".$m["id"]."\",\"title\":\"".$m["title"]."\"},"; } $arr_select_zt=substr($arr_select_zt,0,-1); $json_data.="\"zt\":[".$arr_select_zt."],"; }else{ $json_data.="\"code\":0,\"msg\":\"对不起,目前只有IPAD支持该功能!\","; } break; } $json_data=substr($json_data,0,-1)."}"; echo $json_data; ?>