首页 > 其他分享 >如何采集京东商城的商品 多图 自动分类 自动去水印 多属性自动入库

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

时间:2022-10-20 10:07:02浏览次数:53  
标签:2929 goods attr img 水印 多图 自动 images id

采集的数据结构如下:
颜色:黄|||绿|||紫#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));
?>
遍历数组进行处理:

标签:2929,goods,attr,img,水印,多图,自动,images,id
From: https://blog.51cto.com/u_5112239/5777685

相关文章