Forráskód Böngészése

关于预订单的sql优化

shish 4 éve
szülő
commit
a4b2759ab3
1 módosított fájl, 53 hozzáadás és 4 törlés
  1. 53 4
      sql.txt

+ 53 - 4
sql.txt

@@ -533,12 +533,12 @@ ALTER TABLE xhStatOutMonth DROP INDEX `shop`;
 
 ALTER TABLE xhGhsOrder MODIFY `tkPrice` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '累计退款金额';
 ALTER TABLE xhGhsOrder MODIFY `refundPrice` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '最后一次的退款金额';
-ALTER TABLE xhGhsOrder MODIFY `actPrice` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '实付金额 (扣除优惠、退款 prePrice - discountAmount - tkPrice)';
-ALTER TABLE xhGhsOrder MODIFY `realPrice` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '实付金额 (扣除优惠、退款和平台补贴 prePrice - discountAmount - tkPrice - 平台补贴)';
+ALTER TABLE xhGhsOrder MODIFY `actPrice` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '实付金额 (原价扣除优惠、退款 prePrice - discountAmount - tkPrice) actPrice realPrice作用现在一样';
+ALTER TABLE xhGhsOrder MODIFY `realPrice` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '实付金额 (原价扣除优惠、退款 prePrice - discountAmount - tkPrice) actPrice realPrice作用现在一样';
 ALTER TABLE xhCg MODIFY `tkPrice` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '累计退款金额';
 ALTER TABLE xhCg MODIFY `refundPrice` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '最后一次的退款金额';
-ALTER TABLE xhCg MODIFY `actPrice` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '实付金额 (扣除优惠、退款 prePrice - discountAmount - tkPrice)';
-ALTER TABLE xhCg MODIFY `realPrice` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '实付金额 (扣除优惠、退款和平台补贴 prePrice - discountAmount - tkPrice - 平台补贴)';
+ALTER TABLE xhCg MODIFY `actPrice` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '实付金额 (原价扣除优惠、退款 prePrice - discountAmount - tkPrice) actPrice realPrice作用现在一样';
+ALTER TABLE xhCg MODIFY `realPrice` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '实付金额 (原价扣除优惠、退款 prePrice - discountAmount - tkPrice) actPrice realPrice作用现在一样';
 
 ALTER TABLE xhCg ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `id`;
 ALTER TABLE xhGhsOrder ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `id`;
@@ -565,4 +565,53 @@ ALTER TABLE xhStatSaleMonth DROP INDEX `shop`;
 ALTER TABLE xhShop ADD kiloFee DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '预订单每公斤服务费' AFTER `parentShopId`;
 ALTER TABLE xhShop ADD miniKilo SMALLINT NOT NULL DEFAULT 0 COMMENT '最低公斤数,不足的按这里设置的公斤数计算' AFTER `kiloFee`;
 
+ALTER TABLE xhGhsOrder ADD itemPrice DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '花材金额,产品金额' AFTER `modPrice`;
+ALTER TABLE xhCg ADD `weight` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '花材总重量(公斤)' AFTER `status`;
+
+ALTER TABLE xhGhsOrder ADD kiloFee DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '预订单每公斤服务费' AFTER `weight`;
+ALTER TABLE xhCg ADD kiloFee DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '预订单每公斤服务费' AFTER `weight`;
+ALTER TABLE xhGhsOrder ADD allKiloFee DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '预订单总服务费' AFTER `kiloFee`;
+ALTER TABLE xhCg ADD allKiloFee DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '预订单总服务费' AFTER `kiloFee`;
+
+ALTER TABLE xhGhsOrder ADD debtAmount DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '本单总欠款金额' AFTER `debt`;
+ALTER TABLE xhGhsOrder ADD remainDebtAmount DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '本单剩余欠款金额' AFTER `debtAmount`;
+ALTER TABLE xhCg ADD debtAmount DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '本单总欠款金额' AFTER `debt`;
+ALTER TABLE xhCg ADD remainDebtAmount DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '本单剩余欠款金额' AFTER `debtAmount`;
+
+ALTER TABLE xhGhsOrder ADD orderPrice  DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '订单金额 = 原价扣除优惠,不受退款影响' AFTER `tkPrice`;
+ALTER TABLE xhCg ADD orderPrice  DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '订单金额 = 原价扣除优惠,不受退款影响' AFTER `tkPrice`;
+
+ALTER TABLE xhGhsOrder MODIFY `prePrice` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '原价=花材金额+运费+人工成本(+预订单服务费)';
+ALTER TABLE xhCg MODIFY `prePrice` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '原价=花材金额+运费+人工成本(+预订单服务费)';
+
+ALTER TABLE xhGhsOrder CHANGE debtAmount debtPrice DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '总欠款金额' AFTER `realPrice`;
+ALTER TABLE xhGhsOrder CHANGE remainDebtAmount remainDebtPrice DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '剩余欠款金额' AFTER `debtPrice`;
+ALTER TABLE xhCg CHANGE debtAmount debtPrice DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '总欠款金额' AFTER `realPrice`;
+ALTER TABLE xhCg CHANGE remainDebtAmount remainDebtPrice DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '剩余欠款金额' AFTER `debtPrice`;
+
+ALTER TABLE xhGhsOrder MODIFY `sendCost` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '运费' AFTER `itemPrice`;
+ALTER TABLE xhGhsOrder MODIFY `labourCost` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '人工和资材费用' AFTER `sendCost`;
+ALTER TABLE xhGhsOrder MODIFY `labourCost` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '人工和资材费用' AFTER `sendCost`;
+ALTER TABLE xhGhsOrder MODIFY `weight` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '花材总重量(公斤)' AFTER `labourCost`;
+ALTER TABLE xhGhsOrder MODIFY `kiloFee` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '预订单每公斤服务费' AFTER `weight`;
+ALTER TABLE xhGhsOrder MODIFY `allKiloFee` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '预订单总服务费' AFTER `kiloFee`;
+
+ALTER TABLE xhGhsOrder MODIFY `discount` DECIMAL(3,2) NOT NULL DEFAULT '1.00' COMMENT '享有折扣' AFTER `prePrice`;
+ALTER TABLE xhGhsOrder MODIFY `discountType` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '优惠类型 1没有优惠 2使用平台优惠。类型放在dict.php里' AFTER `discount`;
+ALTER TABLE xhGhsOrder MODIFY `discountAmount` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '优惠金额' AFTER `discountType`;
+
+ALTER TABLE xhGhsOrder MODIFY `orderPrice` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '订单金额 = 原价扣除优惠,不受退款影响' AFTER `discountAmount`;
+
+ALTER TABLE xhCg MODIFY `sendCost` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '运费' AFTER `itemPrice`;
+ALTER TABLE xhCg MODIFY `labourCost` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '人工和资材费用' AFTER `sendCost`;
+ALTER TABLE xhCg MODIFY `weight` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '花材总重量(公斤)' AFTER `labourCost`;
+ALTER TABLE xhCg MODIFY `kiloFee` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '预订单每公斤服务费' AFTER `weight`;
+ALTER TABLE xhCg MODIFY `allKiloFee` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '预订单总服务费' AFTER `kiloFee`;
+
+ALTER TABLE xhCg MODIFY `orderPrice` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '订单金额 = 原价扣除优惠,不受退款影响' AFTER `prePrice`;
+ALTER TABLE xhCg MODIFY `discount` DECIMAL(3,2) NOT NULL DEFAULT '1.00' COMMENT '享有折扣' AFTER `prePrice`;
+ALTER TABLE xhCg MODIFY `discountType` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '优惠类型,在dict.php里' AFTER `discount`;
+ALTER TABLE xhCg MODIFY `discountAmount` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '优惠金额' AFTER `discountType`;
+
+
 ====预订单 ssh 20220321