20250727172015_wuliu.php 4.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. declare(strict_types=1);
  3. use Phinx\Migration\AbstractMigration;
  4. class Wuliu extends AbstractMigration
  5. {
  6. /**
  7. * Change Method.
  8. *
  9. * Write your reversible migrations using this method.
  10. *
  11. * More information on writing migrations is available here:
  12. * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
  13. *
  14. * The following commands can be used in this method and Phinx will
  15. * automatically reverse them when rolling back:
  16. *
  17. * createTable
  18. * renameTable
  19. * addColumn
  20. * renameColumn
  21. * addIndex
  22. * addForeignKey
  23. *
  24. * Remember to call "create()" or "update()" and NOT "save()" when working
  25. * with the Table class.
  26. */
  27. public function change()
  28. {
  29. // {
  30. // "status": "0",/* status 0:正常查询 201:快递单号错误 203:快递公司不存在 204:快递公司识别失败 205:没有信息 207:该单号被限制,错误单号 */
  31. // "msg": "ok",
  32. // "result": {
  33. // "number": "780098068058",
  34. // "type": "zto",
  35. // "list": [{
  36. // "time": "2018-03-09 11:59:26",
  37. // "status": "【石家庄市】快件已在【长安三部】 签收,签收人: 本人,感谢使用中通快递,期待再次为您服务!"
  38. // }, {
  39. // "time": "2018-03-09 09:03:10",
  40. // "status": "【石家庄市】 快件已到达 【长安三部】(0311-85344265),业务员 容晓光(15908220064) 正在第1次派件, 请保持电话畅通,并耐心等待"
  41. // }, {
  42. // "time": "2018-03-08 23:43:44",
  43. // "status": "【石家庄市】 快件离开 【石家庄】 发往 【长安三部】"
  44. // }, {
  45. // "time": "2018-03-08 21:00:44",
  46. // "status": "【石家庄市】 快件到达 【石家庄】"
  47. // }, {
  48. // "time": "2018-03-07 01:38:45",
  49. // "status": "【广州市】 快件离开 【广州中心】 发往 【石家庄】"
  50. // }, {
  51. // "time": "2018-03-07 01:36:53",
  52. // "status": "【广州市】 快件到达 【广州中心】"
  53. // }, {
  54. // "time": "2018-03-07 00:40:57",
  55. // "status": "【广州市】 快件离开 【广州花都】 发往 【石家庄中转】"
  56. // }, {
  57. // "time": "2018-03-07 00:01:55",
  58. // "status": "【广州市】 【广州花都】(020-37738523) 的 马溪 (18998345739) 已揽收"
  59. // }],
  60. // "deliverystatus": "3", /* 0:快递收件(揽件)1.在途中 2.正在派件 3.已签收 4.派送失败 5.疑难件 6.退件签收 */
  61. // "issign": "1", /* 1.是否签收 */
  62. // "expName": "中通快递", /* 快递公司名称 */
  63. // "expSite": "www.zto.com", /* 快递公司官网 */
  64. // "expPhone": "95311", /* 快递公司电话 */
  65. // "courier": "容晓光", /* 快递员 或 快递站(没有则为空)*/
  66. // "courierPhone":"15908220064", /* 快递员电话 (没有则为空) */
  67. // "updateTime":"2019-08-27 13:56:19", /* 快递轨迹信息最新时间 */
  68. // "takeTime":"2天20小时14分", /* 发货到收货消耗时长 (截止最新轨迹) */
  69. // "logo":"https://img3.fegine.com/express/zto.jpg" /* 快递公司LOGO */
  70. // }
  71. //}
  72. $table = $this->table('extension_wuliu', ['comment' => '物流数据']);
  73. $table
  74. ->addColumn('number', 'string', ['limit' => 50, 'default' => '', 'comment' => '快递单号'])
  75. ->addColumn('type', 'string', ['limit' => 32, 'default' => '', 'comment' => '快递公司'])
  76. ->addColumn('list', 'json', ['null' => true, 'comment' => '物流信息'])
  77. ->addColumn('delivery_status', 'tinyinteger', ['signed' => false, 'default' => 0, 'comment' => '物流状态 0:快递收件(揽件)1.在途中 2.正在派件 3.已签收 4.派送失败 5.疑难件 6.退件签收'])
  78. ->addColumn('is_sign', 'tinyinteger', ['signed' => false, 'default' => 0, 'comment' => '是否签收'])
  79. ->addColumn('exp_name', 'string', ['limit' => 100, 'default' => '', 'comment' => '快递公司名称'])
  80. ->addColumn('exp_site', 'string', ['limit' => 255, 'default' => '', 'comment' => '快递公司官网'])
  81. ->addColumn('exp_phone', 'string', ['limit' => 32, 'default' => '', 'comment' => '快递公司电话'])
  82. ->addColumn('courier', 'string', ['limit' => 32, 'default' => '', 'comment' => '快递员'])
  83. ->addColumn('courier_phone', 'string', ['limit' => 32, 'default' => '', 'comment' => '快递员电话'])
  84. ->addColumn('take_time', 'string', ['limit' => 32, 'default' => '', 'comment' => '发货到收货消耗时长'])
  85. ->addColumn('logo', 'string', ['limit' => 255, 'default' => '', 'comment' => '快递公司LOGO'])
  86. ->addTimestamps()
  87. ->addIndex('number')
  88. ->create();
  89. }
  90. }