0){ $json_data.="\"code\":100,"; $str=""; for($i=0;$iquery($query); set_log("设置主图",$c."|".$id); $json_data.="\"code\":100,"; break; case "getselect": $json_data.="\"s_keyword\":\"".$s_keyword."\","; $json_data.="\"check_pic\":\"".$check_pic."\","; // $str=""; $res1=$db->query("select * from ".$table_pre."keyword where cate='bc' order by no"); while($msg1=$db->fetch_array($res1)){ $str.="{\"no\":\"".$msg1["no"]."\",\"title\":\"".$msg1["title"]."\"},"; } $str=deel_end($str); $json_data.="\"select_bc\":{\"no\":\"s_bc\",\"title\":\"".get_cate_title_no("arr_select","bc")."\",\"value\":\"".$s_bc."\",\"op\":[".$str."]},"; // $str=""; $res1=$db->query("select * from ".$table_pre."keyword where cate='category' order by no"); while($msg1=$db->fetch_array($res1)){ $str.="{\"no\":\"".$msg1["no"]."\",\"title\":\"".$msg1["title"]."\"},"; } $str=deel_end($str); $json_data.="\"select_category\":{\"no\":\"s_category\",\"title\":\"".get_cate_title_no("arr_select","category")."\",\"value\":\"".$s_category."\",\"op\":[".$str."]},"; break; default: //默认每页显示20 $page=$page?$page:"1"; $ord_num=12; $start=($page-1)*$ord_num; $end=$ord_num*$page; $con1=""; if($s_keyword || $s_bc || $s_category){ $con1.="where "; if($s_keyword){ $con1.=" (no like '%".$s_keyword."%' or xh like '%".$s_keyword."%') and "; } if($s_category){ $con1.=" category='".$s_category."' and "; } if($s_bc){ $con1.=" bc='".$s_bc."' and "; } $con1=substr($con1,0,-4); } //计算页数 $ct=0; $sql="select * from web_kh ".$con1; $res=$db->query($sql); while($msg=$db->fetch_array($res)){ if($check_pic=="on"){ $arr_color2=explode(",",$msg["color"]); for($j=0;$jquery($q); while($m=$db->fetch_array($r)){ $pic=get_kh_picture($m["no"],$m["main_pic"],$m["color"],$flag_pad_offline); $arr_pic_set=out_good_pic_set_arr($pic,188,188); if($check_pic=="on"){ $str_sign="n"; $arr_color=explode(",",$m["color"]); for($j=0;$j0){ for($i=$start;$i<$end;$i++){ if(in_array($arr_content[$i]["kh"],$arr_content2)){ $content.="{"; $content.="\"id\":\"".$arr_content[$i]["id"]."\","; $content.="\"kh\":\"".$arr_content[$i]["kh"]."\","; $content.="\"yph\":\"".$arr_content[$i]["yph"]."\","; $content.="\"pic_src\":\"".$arr_content[$i]["pic_src"]."\","; $content.="\"pic_w\":\"".$arr_content[$i]["pic_w"]."\","; $content.="\"pic_h\":\"".$arr_content[$i]["pic_h"]."\","; $content.="\"price\":\"".$arr_content[$i]["price"]."\""; $content.="},"; } } } $json_data.="\"data\":[".substr($content,0,-1)."],"; break; } $json_data=substr($json_data,0,-1)."}"; echo $json_data; ?>