sql.txt 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. DROP TABLE IF EXISTS `xhMain`;
  2. CREATE TABLE IF NOT EXISTS `xhMain`(
  3. id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  4. `balance` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '余额',
  5. `freezeBalance` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '提现时被冻结的余额',
  6. `txBalance` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '可提现余额',
  7. `fixBalance` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '只能向推荐人消费的余额,指定余额',
  8. `totalRecharge` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '累计充值',
  9. `totalIncome` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '累计收入',
  10. `totalExpend` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '总支出',
  11. `totalItem` INT(11) NOT NULL DEFAULT '0' COMMENT '总花材数',
  12. `totalSale` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '累计销售额',
  13. `totalStockIn` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '累计入库',
  14. `totalStockOut` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '累计出库',
  15. `cashName` varchar(100) NOT NULL DEFAULT '' COMMENT '收款人姓名',
  16. `cashAccount` varchar(50) NOT NULL DEFAULT '' COMMENT '银行卡号,银行帐号',
  17. `cashBank` varchar(50) NOT NULL DEFAULT '' COMMENT '开户行',
  18. `addTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
  19. `updateTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
  20. )COMMENT='中央,中控';
  21. === shish 20220311
  22. ALTER TABLE xhStatSale ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  23. ALTER TABLE xhStatSaleMonth ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  24. ALTER TABLE xhStatUser ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  25. ALTER TABLE xhStatUserMonth ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  26. ALTER TABLE xhStatOut ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  27. ALTER TABLE xhStatOutMonth ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  28. ALTER TABLE xhPtYeChange ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  29. ALTER TABLE xhShopYeChange ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  30. ALTER TABLE xhShopCapital ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  31. ALTER TABLE xhCash ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  32. ALTER TABLE xhRecharge ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  33. ALTER TABLE xhStaff ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  34. ALTER TABLE xhGhsStatYj ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  35. ALTER TABLE xhGhsStatYjMonth ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  36. ALTER TABLE xhStatVisit ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  37. ALTER TABLE xhStatVisitMonth ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  38. ALTER TABLE xhGhsStatOrderCount ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  39. ALTER TABLE xhStatOrder ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  40. ALTER TABLE xhStatOrderCount ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  41. ALTER TABLE xhStatOrderMonth ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  42. ALTER TABLE xhStatIncome ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  43. ALTER TABLE xhStatIncomeMonth ADD mainId INT NOT NULL DEFAULT 0 COMMENT '中央id' AFTER `shopId`;
  44. === 资产相关表中央化 shish 20220313
  45. 执行供货商资产中央化 ./yii init/ghs-center 【库存也要中央化处理,要加入时来】!!!!
  46. DROP TABLE IF EXISTS `xhStaffMap`;
  47. CREATE TABLE `xhStaffMap` (
  48. `id` INT(11) NOT NULL AUTO_INCREMENT,
  49. `staffId` INT(11) NOT NULL DEFAULT '0' COMMENT '员工id',
  50. `sjId` INT(11) NOT NULL DEFAULT '0' COMMENT '商家id',
  51. `shopId` INT(11) NOT NULL DEFAULT '0' COMMENT '门店id',
  52. `ptStyle` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '所属平台 1花店 2供货商 请查看dict.php',
  53. `addTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
  54. `updateTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  55. PRIMARY KEY (`id`)
  56. ) COMMENT='门店员工关系';
  57. ALTER TABLE xhStaff COMMENT '员工';
  58. ==== 员工中央化 shish 20223013