首页 > 代码库 > shopnc导入商品到大商创

shopnc导入商品到大商创

<?php
//select member_name user_name,member_mobile mobile_phone,member_email email,member_passwd old_psd from shopjl_member
//为商户添加品牌

header("Content-Type: text/html; charset=UTF-8");
$con = mysql_connect("localhost","root","root");
mysql_query("SET NAMES ‘utf8‘");
mysql_select_db("XXX", $con);

$result = mysql_query(" select a.goods_name,a.goods_price,a.store_id,a.goods_body,a.member_id,a.goods_image,a.gc_name,dsc_merchants_shop_information.user_id
from (
    select shopjl_goods.goods_name,shopjl_goods.goods_price,shopjl_goods.store_id,shopjl_goods_common.goods_body,shopjl_store.member_id,shopjl_goods.goods_image,shopjl_goods_common.gc_name
    from shopjl_goods 
    left join shopjl_goods_common on shopjl_goods.goods_commonid = shopjl_goods_common.goods_commonid 
    left join shopjl_store on shopjl_goods.store_id = shopjl_store.store_id   
) a left join dsc_merchants_shop_information on a.store_id = dsc_merchants_shop_information.fleam_sid ");

while($row = mysql_fetch_array($result))
  {
    $row[‘goods_img_url‘] =‘http://www.gnb360.com/data/upload/shop/store/goods/‘.$row[‘store_id‘].‘/‘.$row[‘goods_image‘].‘‘;
    $data[] = $row;
  }
  
  /*  echo "<pre>";
    print_r ($data); */
    
    foreach ($data as $key=>$value){
        mysql_query(" INSERT INTO `gannongbaoss`.`dsc_goods` (goods_name, goods_name_style, goods_sn, bar_code, cat_id, user_cat, brand_id, shop_price, market_price, is_promote, promote_price, promote_start_date, promote_end_date, goods_img, goods_thumb, original_img, keywords, goods_brief, seller_note, goods_weight, goods_number, warn_number, integral, give_integral, is_best, is_new, is_hot, is_on_sale, is_alone_sale, is_shipping, goods_desc, add_time, last_update, goods_type, rank_integral, suppliers_id , goods_shipai, user_id, model_price, model_inventory, model_attr, review_status, group_number, store_new, store_hot, store_best, goods_product_tag, is_xiangou, xiangou_num, xiangou_start_date, xiangou_end_date, largest_amount, pinyin_keyword,stages,stages_rate,g_class)VALUES (‘".$value[‘goods_name‘]."‘, ‘+‘, ‘‘, ‘‘, ‘1489‘, ‘0‘, ‘2330‘, ‘".$value[‘goods_price‘]."‘, ‘".$value[‘goods_price‘]."‘, ‘0‘,‘0‘, ‘0‘, ‘0‘, ‘".$value[‘goods_img_url‘]."‘, ‘".$value[‘goods_img_url‘]."‘, ‘‘, ‘‘, ‘‘, ‘‘, ‘0‘, ‘1000‘, ‘1‘, ‘0‘, ‘0‘, ‘0‘, ‘0‘, ‘0‘, ‘1‘, ‘1‘, 0, ‘

".$value[‘goods_body‘]."

‘, ‘1480609138‘, ‘1480609138‘, ‘0‘, ‘0‘, ‘0‘ , ‘‘, ‘".$value[‘user_id‘]."‘, ‘0‘, ‘0‘, ‘0‘, ‘1‘, ‘0‘, ‘0‘, ‘0‘, ‘0‘, ‘‘, ‘0‘, ‘0‘, ‘0‘, ‘0‘, ‘0‘, ‘shangpinmingcheng‘,‘‘,‘‘,‘".$value[‘gc_name‘]."‘) ");
    }
?>

 

shopnc导入商品到大商创