📄 inc_get_prod_arr.php
字号:
<?php
////////////////////////////////////////////////////////
// Author by Shuweich
// Date : 2008.02.23
// 建站支持: http://www.shuweich.net
// 作者: Shuweich
// QQ: 1502384
// ICQ: 190492112
// MSN: shuweich@hotmail.com
// E-mail: root@shuweich.net
// E-mail: shuweich@163.com
////////////////////////////////////////////////////////
// txdyz 功能模块
// For 商品信息提取
// 2008.02.23 输出XML格式数据
////////////////////////////////////////////////////////
include_once '../../mainfile.php';
include_once 'head_inc.php';
header('Content-Type:text/xml');
echo "<?xml version='1.0' encoding='gb2312' ?>\n";
##
# sp_barcode,sp_name,sp_code,store_id
if ( _SSP == 7 ) $_S_id = '696';
elseif ( _SSP == 1 ) $_S_id = $_REQUEST['s_id0'];
$_S_id = $_REQUEST['s_id0'];
$que = "select ".$mod_fields[$_REQUEST['pload']];
$que.= " from ".$xoopsDB->prefix("market_spinfo");
$que.= " where store_id='".$_S_id."' and sp_barcode='".$_REQUEST['barcode']."' and sp_sh='1' order by 4"; ## 提取公共店商品信息
// echo $que;
$res = $xoopsDB->query($que);
$snm = $xoopsDB->getRowsNum($res);
if ( $snm == 0 && _SSP == 1 ) { ## 生成店铺商品信息数据
$ins = "insert into ".$xoopsDB->prefix("market_spinfo");
$ins .= " (store_id,sp_date,sp_code,sp_level,sp_idcode,sp_barcode,sp_name,sp_desc,sp_readme,sp_sj,sp_bzdw,sp_mz,sp_jz,sp_sh) ";
$ins .= " select '".$_S_id."',sp_date,sp_code,sp_level,sp_idcode,sp_barcode,sp_name,";
$ins .= "sp_desc,sp_readme,sp_sj,sp_bzdw,sp_mz,sp_jz,sp_sh ";
$ins .= " from ".$xoopsDB->prefix("market_spinfo")." where store_id='696'";
$sin0 = $xoopsDB->queryF($ins);
} elseif ( $snm == 0 && _SSP == 7 ) { ## 重建共享商品信息数据
$sinit = "insert into ".$xoopsDB->prefix("market_spinfo");
$sinit.= " (sp_date,sp_code,sp_level,sp_idcode,sp_barcode,sp_name,sp_desc,sp_readme,sp_sj,sp_bzdw,sp_mz,sp_jz,sp_sh) ";
$sinit.= " select now(),concat('1001001',a.products_model),'QS','QS410117010004',a.products_ean,b.products_name,b.short_description,b.products_description,a.products_price,'代',a.products_weight,a.products_weight,'1' ";
$sinit.= " from ".$xoopsDB->prefix("osc_products")." a,".$xoopsDB->prefix("osc_products_description")." b ";
$sinit.= " where a.products_id=b.products_id and b.language_id=1 order by a.products_model";
$sin0 = $xoopsDB->queryF($sinit);
} else {
$snm = $xoopsDB->getRowsNum($res);
if ( $snm == 0 ) echo ""; // echo "<perror>数据调用出错,请联系管理员!</perror>\n";
}
$i=0;
echo "<products>\n";
while ( $row = $xoopsDB->fetchrow($res) ) {
echo " <sku>\n";
echo " <barcode>".$row[0]."</barcode>\n";
echo " <pname>".$row[1]."</pname>\n";
echo " <price>".$row[2]."</price>\n";
echo " <uniqcode>".$row[3]."</uniqcode>\n";
echo " </sku>\n";
$i++;
}
echo "</products>\n";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -