123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- class CreateCustomerDropPoolTabel extends Migrator
- {
- /**
- * Change Method.
- *
- * Write your reversible migrations using this method.
- *
- * More information on writing migrations is available here:
- * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
- *
- * The following commands can be used in this method and Phinx will
- * automatically reverse them when rolling back:
- *
- * createTable
- * renameTable
- * addColumn
- * renameColumn
- * addIndex
- * addForeignKey
- *
- * Remember to call "create()" or "update()" and NOT "save()" when working
- * with the Table class.
- */
- public function change()
- {
- $this->table('customer_drop_pool',['comment' => '客户自动回收表'])
- ->addColumn('customer_id', 'integer', ['limit'=> 11, 'comment' => 'customer id'])
- ->addColumn('uid', 'integer', ['limit'=> 11,'comment' => 'user id', 'null'=> true])
- ->addColumn('employee_id', 'integer', ['limit'=> 11,'comment' => '员工 id'])
- ->addColumn('changed_ori_info', 'text', ['comment' => '记录异动前上一次的老信息,旧employee_id,uid', 'null'=> true])
- ->addColumn('designer_id', 'integer', ['limit'=> 11,'comment' => '设计师id', 'null'=> true])
- ->addColumn('clue_id', 'integer', ['limit'=> 11,'comment' => '客户线索id', 'null'=> true])
- ->addColumn('phone', 'string', ['limit'=> 255,'comment' => '客户电话', 'null'=> true])
- ->addColumn('name', 'string', ['limit'=> 255,'comment' => '客户姓名', 'null'=> true])
- ->addColumn('age_range', 'string', ['limit'=> 255, 'comment' => '客户年龄', 'null'=> true])
- ->addColumn('level', 'string', ['limit'=> 255,'comment' => '客户等级 A B C', 'null'=> true])
- ->addColumn('state', 'string', ['limit'=> 255,'comment' => '客户状态:已到店,已交定,已签单', 'null'=> true])
- ->addColumn('community_name', 'string', ['limit'=> 255,'comment' => '小区名', 'null'=> true])
- ->addColumn('house_type', 'string', ['limit'=> 255,'comment' => '房屋类型 如 毛坯 精装 老房等', 'null'=> true])
- ->addColumn('house_delivery_time', 'string', ['limit'=> 255,'comment' => '交房时间', 'null'=> true])
- ->addColumn('plan_deco_time', 'string', ['limit'=> 255,'comment' => '预计装修时间', 'null'=> true])
- ->addColumn('square', 'string', ['limit'=> 255,'comment' => '房屋大小', 'null'=> true])
- ->addColumn('deco_style', 'string', ['limit'=> 255,'comment' => '装修风格', 'null'=> true])
- ->addColumn('budget', 'string', ['limit'=> 255,'comment' => '预算', 'null'=> true])
- ->addColumn('revisit_time', 'timestamp', ['comment' => '客户跟进,下次业务员回访时间(业务员填写)', 'null'=> true])
- ->addColumn('addtime', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '添加时间'])
- ->addColumn('updatetime', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '修改时间', 'update'=> 'CURRENT_TIMESTAMP'])
- ->addColumn('protected_to', 'timestamp', ['comment' => '保护至xx日', 'null'=> true])
- ->addColumn('org_id', 'integer', ['limit'=> 11,'comment' => '部门'])
- ->addColumn('crm_res_id', 'integer', ['limit'=> 11,'comment' => 'crm_import_log id', 'null'=> true])
- ->addColumn(Column::tinyInteger('is_resource')->setComment('是否属于资源库')->setDefault(0))
- ->addColumn('before_pool', 'string', ['limit'=> 255,'comment' => '入公海前操作信息', 'null'=> true])
- ->addColumn(Column::tinyInteger('bad_phone')->setComment('电话无效 1为无效')->setDefault(0))
- ->addColumn(Column::tinyInteger('fresh')->setComment('新客户')->setDefault(1))
- ->addColumn(Column::binary('sex')->setComment('性别')->setDefault(null))
- ->addColumn('first_visit_date', 'date', ['comment' => '首次到访时间', 'null'=> true])
- ->addColumn('last_contact_date', 'date', ['comment' => '上次沟通时间', 'null'=> true])
- ->addColumn('product', 'string', ['limit'=> 50,'comment' => '关注点', 'null'=> true])
- ->addColumn('source_id', 'integer', ['limit'=> 11,'comment' => '来源', 'null'=> true])
- ->addColumn('remark', 'string', ['limit'=> 255, 'comment'=>'备注', 'default'=> ''])
- ->addColumn('ext', 'json', ['comment'=>'扩展字段', 'null'=> true])
- ->addColumn('deposit_money', 'integer', ['limit'=> 11, 'comment'=> '收定金额', 'null'=> true])
- ->addColumn('signed_money', 'integer', ['limit'=> 11, 'comment'=> '签单金额', 'null'=> true])
- ->addColumn('aid', 'integer', ['limit'=> 11, 'comment'=> '预约活动id', 'default'=> 0])
- ->addColumn('house_status', 'string', ['limit'=> 255, 'comment'=> '房屋状态', 'default'=> ''])
- ->addColumn('agents_id', 'integer', ['limit'=> 11, 'comment'=> '所属经纪id', 'null'=> true])
- ->addColumn(Column::tinyInteger('agent_source_type')->setComment('经纪人客户来源 1表示手动报备2表示活动报名录入')->setDefault(1))
- ->addColumn('droptime', 'timestamp', ['comment'=>'删除时间', 'default' => 'CURRENT_TIMESTAMP'])
- ->addColumn('phone1', 'string', ['limit'=> 150, 'comment'=> '其他电话1', 'default'=> ''])
- ->addColumn('phone2', 'string', ['limit'=> 150, 'comment'=> '其他电话2', 'default'=> ''])
- ->create();
- }
- }
|