# 10:36 2021/8/11
ALTER TABLE `slides`
	ADD INDEX `agent_id` (`agent_id`);
ALTER TABLE `specials`
	ADD INDEX `agent_id` (`agent_id`);
ALTER TABLE `suppliers`
	ADD UNIQUE INDEX `account` (`account`);
ALTER TABLE `orders`
	ADD INDEX `mobile` (`mobile`);

# 16:32 2021/8/11
ALTER TABLE `users`
	CHANGE COLUMN `unionid` `unionid` VARCHAR(64) NOT NULL COMMENT '微信unionid' COLLATE 'utf8mb4_unicode_ci' AFTER `agent_id`;

# 19:14 2021/8/11
ALTER TABLE `agents`
	ADD COLUMN `agent_name` VARCHAR(50) NOT NULL COMMENT '代理商名称' AFTER `password`;
ALTER TABLE `agents`
	ADD UNIQUE INDEX `account` (`account`);

ALTER TABLE `suppliers`
	ADD COLUMN `supplier_name` VARCHAR(50) NOT NULL COMMENT '供应商名称' AFTER `password`;

#11:15 2021/8/12
ALTER TABLE `suppliers`
	ADD COLUMN `status` TINYINT(3) NOT NULL DEFAULT '0' COMMENT '1:启用；0:待审核；-1:审核拒绝；-2:禁用' AFTER `supplier_name`,
	ADD COLUMN `company_name` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '公司名称' AFTER `status`,
	ADD COLUMN `logo` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'LOGO' AFTER `company_name`,
	ADD COLUMN `address` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '公司地址' AFTER `logo`,
	ADD COLUMN `license_pic` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '营业执照' AFTER `address`,
	ADD COLUMN `director` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '负责人' AFTER `license_pic`,
	ADD COLUMN `contact_phone` VARCHAR(15) NOT NULL DEFAULT '' COMMENT '联系电话' AFTER `director`;

ALTER TABLE `agents`
	ADD COLUMN `company_name` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '公司名称' COLLATE 'utf8_general_ci' AFTER `status`,
	ADD COLUMN `logo` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'LOGO' COLLATE 'utf8_general_ci' AFTER `company_name`,
	ADD COLUMN `address` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '公司地址' COLLATE 'utf8_general_ci' AFTER `logo`,
	ADD COLUMN `license_pic` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '营业执照' COLLATE 'utf8_general_ci' AFTER `address`,
	ADD COLUMN `director` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '负责人' COLLATE 'utf8_general_ci' AFTER `license_pic`,
	ADD COLUMN `contact_phone` VARCHAR(15) NOT NULL DEFAULT '' COMMENT '联系电话' COLLATE 'utf8_general_ci' AFTER `director`;

ALTER TABLE `suppliers`
	ADD COLUMN `deleted_at` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `updated_at`;

ALTER TABLE `agents`
	ADD COLUMN `deleted_at` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `updated_at`;

ALTER TABLE `agents`
	CHANGE COLUMN `status` `status` TINYINT(3) NOT NULL DEFAULT '0' COMMENT '1:启用；0:待审核；-1:审核拒绝；-2:禁用' AFTER `mchkey`;

ALTER TABLE `categories`
	CHANGE COLUMN `agent_id` `agent_id` INT(10) NOT NULL DEFAULT '0' COMMENT '代理商ID，0为系统和供应商共用分类' AFTER `id`;


# 9:26 2021/8/13
ALTER TABLE `channels`
	CHANGE COLUMN `agent_id` `agent_id` INT(10) NOT NULL DEFAULT '0' COMMENT '代理商ID，0表示系统默认分类' AFTER `id`;

# 16:47 2021/8/13
CREATE TABLE `guides` (
	`id` INT(10) NOT NULL AUTO_INCREMENT,
	`account` VARCHAR(50) NOT NULL COMMENT '账号' COLLATE 'utf8_general_ci',
	`password` CHAR(32) NOT NULL COMMENT '密码' COLLATE 'utf8_general_ci',
	`guide_name` VARCHAR(50) NOT NULL COMMENT '地接名称' COLLATE 'utf8_general_ci',
	`photo` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '形象照' COLLATE 'utf8_general_ci',
	`license_pic` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '地接资格证件' COLLATE 'utf8_general_ci',
	`contact_phone` VARCHAR(15) NOT NULL DEFAULT '' COMMENT '联系电话' COLLATE 'utf8_general_ci',
	`status` TINYINT(3) NOT NULL DEFAULT '0' COMMENT '1:启用；0:待审核；-1:审核拒绝；-2:禁用',
	`created_at` INT(10) UNSIGNED NOT NULL DEFAULT '0',
	`updated_at` INT(10) UNSIGNED NOT NULL DEFAULT '0',
	`deleted_at` INT(10) UNSIGNED NULL DEFAULT NULL,
	PRIMARY KEY (`id`) USING BTREE,
	UNIQUE INDEX `account` (`account`) USING BTREE
)
COMMENT='地接'
COLLATE='utf8_general_ci'
ENGINE=InnoDB;

-----------------------------------




