您的位置:首页 > 其它

如何采集京东商城的商品 多图 自动分类 自动去水印 多属性自动入库

2012-11-27 17:43 309 查看
采集的数据结构如下:

颜色:黄|||绿|||紫#900;尺寸:10|||20|||30#60

一条标签采集50个以上的属性;自动入库,自动判断属性种类,自动根据SKU 属性价格 ecshop属性价格 属性 全自动入库。

监控 ecshop添加商品和属性的时候执行的sql语句:

INSERT INTO `kuuqii`.`ecs_goods` (goods_name, goods_name_style, goods_sn, cat_id, 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)VALUES ('hp1234', '+', 'df234', '181', '', '12345',
'14814', '0','0', '0', '0', 'images/201211/1354023298211550489.jpg', 'images/201211/1354023299995628165.jpg', 'images/201211/1354023297537768203.jpg', '', '', '', '0', '1', '1', '123', '-1', '0', '0', '0', '1', '1', 0, '<p> adfdasfaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>',
'1354023299', '1354023299', '5', '-1', '0')

82 Query INSERT INTO `kuuqii`.`ecs_admin_log` (log_time, user_id, log_info, ip_address) VALUES ('1354023299', 1, '添加商品: hp1234', '127.0.0.1')

82 Query INSERT INTO `kuuqii`.`ecs_goods_attr` (attr_id, goods_id, attr_value, attr_price)VALUES ('82', '2929', 'h100', '0')

82 Query INSERT INTO `kuuqii`.`ecs_goods_attr` (attr_id, goods_id, attr_value, attr_price)VALUES ('84', '2929', '14', '0')

82 Query INSERT INTO `kuuqii`.`ecs_goods_gallery` (goods_id, img_url, img_desc, thumb_url, img_original) VALUES ('2929', 'images/201211/goods_img/2929_P_1354023299499.jpg', '', 'images/201211/thumb_img/2929_thumb_P_1354023299810.jpg',
'images/201211/source_img/2929_P_1354023299653.jpg')

将属性全自动获取出来成为以下形式——$str="品牌:快客;名称:笔记本;尺寸:14";

<?php

/*

* Created on 2012-7-17

*

* write by harry

*

*/

// phpinfo();

$str="品牌:快客;名称:笔记本;尺寸:14";

$arr=explode(';',$str);

$arr_attibute=array();

//print_r(explode(';',$str));

foreach($arr as $key=>$value)

{

$arr2=explode(':',$value);

$k=$arr2[0];

$v=$arr2[1];

$arr_attibute[$k]=$v;

}

print_r($arr_attibute);

$str_j="品牌:快客,名称:笔记本,尺寸:14";

print_r(json_decode($str_j));

?>

遍历数组进行处理:
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: