caching = true; } $affiliate = unserialize($GLOBALS['_CFG']['affiliate']); $smarty->assign('affiliate', $affiliate); /* 代码增加_start */ if(!empty($_REQUEST['act']) && $_REQUEST['act'] == 'get_pickup_info') { $province = $_REQUEST['province']; $city = $_REQUEST['city']; $district = $_REQUEST['district']; $suppid = intval($_REQUEST['suppid']); $city_info = get_city_info($province, $city, $district); $where = 'where supplier_id='.$suppid; if($city_info['province_id']>0 && $city_info['city_id']>0) { $where .= ' and province_id=' . $city_info['province_id'] . ' and city_id=' . $city_info['city_id']; $sql = 'select * from ' . $GLOBALS['ecs']->table('pickup_point') . $where; $pickup_point_list = $GLOBALS['db']->getAll($sql); die(json_encode(array('error' => 0, 'result' => $pickup_point_list, 'city_info' => $city_info))); } else die(json_encode(array('error' => 1))); } elseif (!empty($_REQUEST['act']) && $_REQUEST['act'] == 'get_area_list') { $parent_id = $_REQUEST['parent_id']; $sql = 'select region_id, region_name, region_type from ' . $GLOBALS['ecs']->table('region'). ' where parent_id=' . $parent_id; $area_list = $GLOBALS['db']->getAll($sql); die(json_encode($area_list)); } elseif (!empty($_REQUEST['act']) && $_REQUEST['act'] == 'get_pickup_point_list') { $district_id = $_REQUEST['district_id']; //$sql = 'select * from ' . $GLOBALS['ecs']->table('pickup_point') . ' where district_id=' . $district_id; $suppid = intval($_REQUEST['suppid']); $sql = 'select * from ' . $GLOBALS['ecs']->table('pickup_point') . ' where district_id=' . $district_id.' and supplier_id='.$suppid; $pickup_point_list = $GLOBALS['db']->getAll($sql); die(json_encode($pickup_point_list)); } /* 代码增加_end */ /*------------------------------------------------------ */ //-- INPUT /*------------------------------------------------------ */ $goods_id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; /* 代码增加_start */ $path_name = isset($_REQUEST['path_name']) ? trim($_REQUEST['path_name']) : ''; if($path_name) { $pathrow = $db->getRow("select c.path_name,c.cat_id from ". $ecs->table('goods')." AS g left join ". $ecs->table('category') ." AS c on g.cat_id=c.cat_id where g.goods_id='$goods_id'" ); $pathrow['path_name'] = $pathrow['path_name'] ? $pathrow['path_name'] : ("cat".$pathrow['cat_id']); if ($path_name != $pathrow['path_name']) { ecs_header("Location: ../\n"); exit; } } /* 代码增加_end */ /* 代码增加_start */ $sql_attr_www_ecshop68_com="SELECT a.attr_id, ga.goods_attr_id FROM ". $GLOBALS['ecs']->table('attribute') . " AS a left join ". $GLOBALS['ecs']->table('goods_attr') . " AS ga on a.attr_id=ga.attr_id WHERE a.is_attr_gallery=1 and ga.goods_id='" . $goods_id. "' order by ga.goods_attr_id "; $goods_attr=$GLOBALS['db']->getRow($sql_attr_www_ecshop68_com); if($goods_attr){ $goods_attr_id=$goods_attr['goods_attr_id']; $smarty->assign('attr_id', $goods_attr['attr_id']); }else{ $smarty->assign('attr_id', 0); } if (!empty($_REQUEST['act']) && $_REQUEST['act'] == 'get_gallery_attr') { include('includes/cls_json.php'); $json = new JSON; $goods_attr_id=$_REQUEST['goods_attr_id']; $gallery_list_www_ecshop68_com=get_goods_gallery_attr_www_ecshop68_com($goods_id, $goods_attr_id); $gallery_content=array(); $gallery_content['thumblist'] ='