2018_10_23_155026_update_order_express.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class UpdateOrderExpress extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. if (Schema::hasTable('yz_order_express')) {
  15. $companies = [
  16. 'shunfeng' => 'SF',
  17. 'huitongkuaidi' => 'HTKY',
  18. 'zhongtong' => 'ZTO',
  19. 'shentong' => 'STO',
  20. 'yuantong' => 'YTO',
  21. 'yunda' => 'YD',
  22. 'youzhengguonei' => 'YZPY',
  23. 'ems' => 'EMS',
  24. 'tiantian' => 'HHTT',
  25. 'youshuwuliu' => 'UC',
  26. 'debangwuliu' => 'DBL',
  27. 'zhaijisong' => 'ZJS',
  28. 'tnt' => 'TNT',
  29. 'ups' => 'UPS',
  30. 'fedex' => 'FEDEX',
  31. ];
  32. foreach ($companies as $key => $com) {
  33. \app\common\models\order\Express::where('express_code', $key)->update(['express_code' => $com]);
  34. }
  35. }
  36. }
  37. /**
  38. * Reverse the migrations.
  39. *
  40. * @return void
  41. */
  42. public function down()
  43. {
  44. //
  45. }
  46. }