image.png

image.png

采购表

  1. CREATE TABLE `t_purchase`(
  2. `id` INT UNSIGNED PRIMARY KEY AUTO_INCREMENT COMMENT '供货商ID',
  3. `sku_id` INT UNSIGNED NOT NULL COMMENT '商品ID',
  4. `number` INT UNSIGNED NOT NULL COMMENT '采购数量',
  5. `warehouse_id` INT UNSIGNED NOT NULL COMMENT '仓库ID',
  6. `in_price` DECIMAL(10, 2) UNSIGNED NOT NULL COMMENT '采购价格',
  7. `out_price` DECIMAL(10, 2) UNSIGNED NOT NULL COMMENT '零售价',
  8. `buyer_Id` INT UNSIGNED NOT NULL COMMENT '采购员ID',
  9. `status` TINYINT UNSIGNED NOT NULL COMMENT '状态:1未完成,2已完成',
  10. `created_at` TIMESTAMP NOT NULL DEFAULT NOW() COMMENT '创建时间',
  11. INDEX idx_sku_id(`sku_id`),
  12. INDEX idx_warehouse_id(`warehouse_id`),
  13. INDEX idx_buyer_id(`buyer_id`),
  14. INDEX idx_status(`status`),
  15. INDEX idx_created_at(`created_at`)
  16. ) COMMENT = '采购表';

入库表