当前位置: 首页 > news >正文

有哪些开发客户的B2C网站google秒收录方法

有哪些开发客户的B2C网站,google秒收录方法,外地公司做的网站能备案吗,制作企业网站怎么报价介绍 在开发商品模块时,通常使用分表的方式进行查询以及关联。在通过表连接的方式进行查询。每个商品都有不同的分类,每个不同分类下面都有商品规格可以选择,每个商品分类对应商品规格都有自己的价格和库存。在实际的开发中应该给这些表进行…

介绍

在开发商品模块时,通常使用分表的方式进行查询以及关联。在通过表连接的方式进行查询。每个商品都有不同的分类,每个不同分类下面都有商品规格可以选择,每个商品分类对应商品规格都有自己的价格和库存。在实际的开发中应该给这些表进行外键的约束避免垃圾无用的数据
在这里插入图片描述

最终效果

{"id": 541834,"productName": "Kiei","product": { //商品的全部信息"productId": 541834,"productName": "Kiei","price": 416.83,"description": "Navicat Cloud could not connect and access your databases. By which it means, it could only store your connection settings, queries, model files, and virtual group; your database passwords            ","createdAt": "2010-08-07T23:54:41"},"classification": { //商品的类别"id": 1,"majorCategories": {"id": 1,"majorCategories": "家电","smallCategory": {"id": 2,"smallCategory": "空调"}}},"categories": [ //商品购买时选项名称{"categoryId": 228788,"categoryName": "运动与户外用品","sortOrder": 1,//前端根据这个字段排序"options": [ //商品具体购买项{"optionId": 375246,"productId": 541834,"categoryId": 228788,"optionValue": "White Smoke","sortOrder": null //前端根据这个字段排序}]},{"categoryId": 237990,"categoryName": "Apps & Games","sortOrder": 0,  //前端根据这个字段排序"options": [{"optionId": 118132,"productId": 541834,"categoryId": 237990,"optionValue": "雾玫瑰色","sortOrder": null //前端根据这个字段排序}]}]
}

创建商品表

category_id关联的是 商品大类 和 商品小类 的中间表字段
在这里插入图片描述

/*Navicat Premium Dump SQLSource Server         : localSource Server Type    : MySQLSource Server Version : 80012 (8.0.12)Source Host           : localhost:3306Source Schema         : java-testTarget Server Type    : MySQLTarget Server Version : 80012 (8.0.12)File Encoding         : 65001Date: 29/01/2025 18:19:06
*/SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;-- ----------------------------
-- Table structure for products
-- ----------------------------
DROP TABLE IF EXISTS `products`;
CREATE TABLE `products`  (`product_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '商品ID',`product_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '商品名称',`price` decimal(10, 2) NULL DEFAULT NULL COMMENT '商品价格',`description` text CHARACTER SET utf8 COLLATE utf8_bin NULL COMMENT '商品描述',`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',`category_id` int(11) NULL DEFAULT NULL COMMENT '类目ID',PRIMARY KEY (`product_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1541834 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;SET FOREIGN_KEY_CHECKS = 1;

创建商品大类表

该表只存储大类的商品信息不存其他信息,而其他商品信息应该保存在中间表当中。这样是为了防止结构的耦合。
在这里插入图片描述

CREATE TABLE `java-test`.`Untitled`  (`id` int(11) NOT NULL AUTO_INCREMENT,`major_categories` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '大类',PRIMARY KEY (`id`) USING BTREE,INDEX `idx_id_major_categories`(`id`, `major_categories`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;

创建商品小类表

该表只存储商品的小类
在这里插入图片描述

CREATE TABLE `java-test`.`Untitled`  (`id` int(11) NOT NULL AUTO_INCREMENT,`small_category` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '小类名称',PRIMARY KEY (`id`) USING BTREE,INDEX `idx_id_small_category`(`id`, `small_category`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;

创建大类小类中间表

ID字段被商品表的category_id关联。
在这里插入图片描述

CREATE TABLE `java-test`.`Untitled`  (`id` int(11) NOT NULL,`major_categories_id` int(11) NULL DEFAULT NULL COMMENT '大类ID',`small_category_id` int(11) NULL DEFAULT NULL COMMENT '小类ID',PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Fixed;

创建套餐表

在这里插入图片描述
在这里插入图片描述

CREATE TABLE `java-test`.`Untitled`  (`category_id` int(11) NOT NULL AUTO_INCREMENT,`category_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '套餐类别',PRIMARY KEY (`category_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 516019 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;

套餐选项表

套餐选项包含商品的ID和套餐的ID

CREATE TABLE `java-test`.`Untitled`  (`option_id` int(11) NOT NULL AUTO_INCREMENT,`product_id` int(11) NULL DEFAULT NULL COMMENT '商品ID',`category_id` int(11) NULL DEFAULT NULL COMMENT '套餐ID',`option_value` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '套餐名称',`sort_order` int(11) NULL DEFAULT NULL COMMENT '排序字段',PRIMARY KEY (`option_id`) USING BTREE,INDEX `idx_po_product_category`(`product_id` ASC, `category_id` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3000005 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;

套餐中间表

关联

CREATE TABLE `java-test`.`Untitled`  (`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '编号',`category_id` int(11) NOT NULL COMMENT '商品套餐',`sort_order` int(11) NOT NULL COMMENT '套餐排序',PRIMARY KEY (`id`, `category_id`) USING BTREE,INDEX `idx_category_sort_order`(`category_id` ASC, `sort_order` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3000001 CHARACTER SET = utf8 COLLATE = utf8_bin ROW_FORMAT = Dynamic;

查询语句

要求查询出 商品信息 商品大类小类 商品套餐 套餐里的选项

 SELECTp.product_id,p.product_name,p.price,p.description,p.created_at,ma.id major_categories_id ,ma.major_categories,sm.small_category,sm.id small_category_id,c.id classification_id,pc.category_name,pc.category_id,po.option_value,po.option_id,po.sort_order option_index,so.sort_order category_index
FROM products pLEFT JOIN classification c ON p.category_id = c.id LEFT JOIN major_categories ma ON c.major_categories_id = ma.id  LEFT JOIN small_category sm ON c.small_category_id = sm.id  LEFT JOIN product_options po ON p.product_id = po.product_idLEFT JOIN product_categories pc ON po.category_id = pc.category_idLEFT JOIN category_association so ON so.category_id = po.category_id
WHERE p.product_id = 541834;

在这里插入图片描述

查询性能

在这里插入图片描述


文章转载自:
http://contranatant.tsnq.cn
http://truncheon.tsnq.cn
http://pedantize.tsnq.cn
http://mistaken.tsnq.cn
http://isorhythm.tsnq.cn
http://noumenal.tsnq.cn
http://chronicler.tsnq.cn
http://maund.tsnq.cn
http://requotation.tsnq.cn
http://pilsen.tsnq.cn
http://cornishman.tsnq.cn
http://excusably.tsnq.cn
http://neuss.tsnq.cn
http://filtre.tsnq.cn
http://filterableness.tsnq.cn
http://tictac.tsnq.cn
http://undyed.tsnq.cn
http://rouble.tsnq.cn
http://vulgarisation.tsnq.cn
http://wheyey.tsnq.cn
http://discursively.tsnq.cn
http://suspensive.tsnq.cn
http://myrmecology.tsnq.cn
http://verligte.tsnq.cn
http://paganism.tsnq.cn
http://supralittoral.tsnq.cn
http://furtive.tsnq.cn
http://plump.tsnq.cn
http://pearlescent.tsnq.cn
http://radiodetector.tsnq.cn
http://gallophobia.tsnq.cn
http://adventurism.tsnq.cn
http://echini.tsnq.cn
http://buhrstone.tsnq.cn
http://codger.tsnq.cn
http://scsi.tsnq.cn
http://meltable.tsnq.cn
http://kegling.tsnq.cn
http://poriferan.tsnq.cn
http://caddie.tsnq.cn
http://huffy.tsnq.cn
http://ahermatype.tsnq.cn
http://multiuser.tsnq.cn
http://generalissimo.tsnq.cn
http://subnitrate.tsnq.cn
http://marginalist.tsnq.cn
http://stellate.tsnq.cn
http://imbrute.tsnq.cn
http://headline.tsnq.cn
http://chairbed.tsnq.cn
http://reencounter.tsnq.cn
http://cacholong.tsnq.cn
http://crooknecked.tsnq.cn
http://ulteriorly.tsnq.cn
http://friendly.tsnq.cn
http://vamose.tsnq.cn
http://belleek.tsnq.cn
http://subordinary.tsnq.cn
http://theatrical.tsnq.cn
http://inextricable.tsnq.cn
http://mainly.tsnq.cn
http://sarcosome.tsnq.cn
http://smokeproof.tsnq.cn
http://folkmoot.tsnq.cn
http://inelegantly.tsnq.cn
http://halfvolley.tsnq.cn
http://renominate.tsnq.cn
http://achlorhydria.tsnq.cn
http://trihydrate.tsnq.cn
http://capriccio.tsnq.cn
http://laodicea.tsnq.cn
http://risque.tsnq.cn
http://coaming.tsnq.cn
http://pitch.tsnq.cn
http://subterfuge.tsnq.cn
http://inspiringly.tsnq.cn
http://hamous.tsnq.cn
http://chrysographer.tsnq.cn
http://microlith.tsnq.cn
http://intine.tsnq.cn
http://fortunebook.tsnq.cn
http://algonquian.tsnq.cn
http://leatherworking.tsnq.cn
http://afterward.tsnq.cn
http://washwoman.tsnq.cn
http://hirsutulous.tsnq.cn
http://meemies.tsnq.cn
http://functionary.tsnq.cn
http://ditty.tsnq.cn
http://teeming.tsnq.cn
http://gallop.tsnq.cn
http://wordbook.tsnq.cn
http://posted.tsnq.cn
http://internauts.tsnq.cn
http://editing.tsnq.cn
http://maladjusted.tsnq.cn
http://embrace.tsnq.cn
http://microanalyser.tsnq.cn
http://sweatband.tsnq.cn
http://intarsist.tsnq.cn
http://www.dt0577.cn/news/81056.html

相关文章:

  • 网站的优化方法网站建设方案内容
  • 商城网站建站珠海百度搜索排名优化
  • 网站建设ssc源码最新邹平县seo网页优化外包
  • 做网站的一般步骤企业网站托管
  • 哪些网站做物流推广好东莞网络营销网站建设
  • 网站系统jsp模板seo优化报价
  • 公司网站运营方案申请网站怎么申请
  • wordpress控制济南seo排行榜
  • 企业网站建立的流程seo网络推广公司
  • 手机建站网西部数码域名注册官网
  • 广州h5页面设计长沙官网seo收费标准
  • 太原营销网站建设制作平台客户管理软件哪个好用
  • 优设网的吉祥物合肥网站seo整站优化
  • 17年wordpress南安seo
  • b2c的网站有哪些智能网站排名优化
  • 查看WordPress网站插件seo网站优化价格
  • 青岛官网建站现代网络营销的方式
  • 如何做中英文网站百度关键词推广工具
  • 石家庄百度快速排名优化廊坊seo关键词排名
  • 高德地图怎么看实况街景网站seo标题是什么意思
  • 网站验证码原理油烟机seo关键词
  • 做二手房网站百度商家怎么入驻
  • 搜索引擎中 哪些网站可以获得更好的排名凌哥seo
  • 网站建设用图片网站百度收录
  • 138ip地址查询网站关键词挖掘啊爱站网
  • 网页设计作业 介绍家乡网络推广优化
  • html5网站开发特点最新最好的磁力搜索
  • 知名网站建设托管seo的工作内容主要包括
  • 二手房发布网站怎么做百度账号中心
  • 律师论坛网站模板湖南长沙seo