123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- use app\model\Customer;
- use think\facade\Db;
- use think\migration\Migrator;
- class UpdateCustomerStateValue 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()
- {
- Db::query("update fl_customer set state=0 where state in('待确认');");
- Db::query("update fl_customer set state=1 where state in('未到访');");
- Db::query("update fl_customer set state=2 where state in('已到访', '确认到店', '确定到店', '已到店');");
- Db::query("update fl_customer set state=3 where state in('确定到场', '确认到场', '已到场');");
- Db::query("update fl_customer set state=4 where state in('已量房', '确定量房', '确认量房');");
- Db::query("update fl_customer set state=5 where state in('定金', '交定', '已交定');");
- Db::query("update fl_customer set state=6 where state in('签单', '已签单');");
- Db::query("update fl_customer set state=7 where state in('无效');");
- Db::query("update fl_customer set state=8 where state in('已卖卡');");
- }
- }
|