项目实战-tpshop商城项目

项目实战-tpshop商城项目

环境部署准备

软件工具准备

  • 虚拟机(本地)/云服务器(实体机)--远程服务
  • vmware虚拟机(电脑)
  • Linux
  • centos-->Linux系统的一个发行版本
  • 电脑上的系统

远程连接测试

远程连接测试-查看虚拟机IP地址

在linux虚拟机中输入ifconfig命令,查看对应的IP地址。

远程连接测试-检测本机与虚拟机是否连通

远程连接测试-通过远程工具连接linux服务器

常见问题处理

环境部署

项目技术架构介绍

部署tpshop项目-tpshop验证

数据库验证

用户信息表
  • 用户信息表: tp_users

  • 用户地址信息表: tp_user_address

熟悉商品表信息
  • 商品信息表: tp_goods
  • 商品分类信息表: tp_goods_category
  • 商品图片信息表: tp_goods_image

订单表信息
  • 订单信息表: tp_order
  • 订单商品信息表: tp_order_goods
  • 购物车表: tp_cart

数据查询演练

查询Tpshop的商品分类信息
  • 在数据库中查询出商品分类类目


  • 查询出手机数码的分类类目
sql 复制代码
-- 查询手机数码的分类类目
-- 如何找到31
select name from tp_goods_category where parent_id=31

-- 手机数码的id就是31
select id from tp_goods_category where mobile_name='手机数码'

-- 上一步的子查询(充当条件)
select name from tp_goods_category where parent_id=(
select id from tp_goods_category where mobile_name='手机数码'
)

-- 查询手机通讯的分类类目
-- 如何找到32
select name from tp_goods_category where parent_id=32

-- 手机通讯的id就是32
select id from tp_goods_category where name='手机通讯'

-- 上一步的子查询(充当条件)
select name from tp_goods_category where parent_id=(
select id from tp_goods_category where name='手机通讯'
)
查询Tpshop的订单信息
sql 复制代码
-- 查询Tpshop中当前用户的订单的信息
-- 13800138006
-- 1.找到登录用户的user_id,用手机号进行过滤
select user_id from tp_users where mobile='13800138006'
-- 2.找订单,通过user_id,进行过滤
select * from tp_order where user_id
-- 3.子查询
select * from tp_order where user_id=(
select user_id from tp_users where mobile='13800138006'
)
-- 4.返回订单的order_id
select order_id from tp_order where user_id=(
select user_id from tp_users where mobile='13800138006'
)
-- 5.查商品信息
select * from tp_order_goods where order_id in (
select order_id from tp_order where user_id=(
select user_id from tp_users where mobile='13800138006'
)
)
查询Tpshop中购物车的信息
sql 复制代码
-- 查询出Tpshop当前用户的购物车的信息
select user_id from tp_users where mobile='13800138006'
select * from tp_cart where user_id=(
select user_id from tp_users where mobile='13800138006'
)
相关推荐
August_._16 分钟前
【MySQL】SQL语法详细总结
java·数据库·后端·sql·mysql·oracle
升鲜宝供应链及收银系统源代码服务44 分钟前
升鲜宝生鲜配送供应链管理系统---PMS--商品品牌多语言存储与 Redis 缓存同步实现
java·开发语言·数据库·redis·缓存·开源·供应链系统
苦学编程的谢2 小时前
Redis_8_List
数据库·redis·缓存
曹天骄2 小时前
阿里云 DCDN → CDN 无缝切换教程(以 example.com 为例)
数据库·阿里云·云计算
workflower3 小时前
软件工程-练习
数据库·需求分析·个人开发·极限编程·结对编程
扶尔魔ocy4 小时前
【QT自定义2D控件】QGraphics绘制仪表盘
数据库·qt·microsoft
yookay zhang4 小时前
达梦数据库监听进程
网络·数据库·oracle
Archy_Wang_14 小时前
centos7的mysql做定时任务备份所有数据库
数据库·mysql
Java 码农4 小时前
MySQL基础操作案例设计
数据库·mysql
友友马5 小时前
『 QT 』按钮类控件属性解析
开发语言·数据库·qt