2020_07_20_145308_truncate_mini_app_template.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class TruncateMiniAppTemplate extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. if (Schema::hasTable('yz_mini_app_template_message')) {
  15. \Illuminate\Support\Facades\DB::table('yz_mini_app_template_message')->truncate();
  16. }
  17. if (Schema::hasTable('yz_mini_template_corresponding')) {
  18. \Illuminate\Support\Facades\DB::table('yz_mini_template_corresponding')->where("template_name","退款成功通知")->update(["template_name"=>"订单退款通知"]);
  19. \Illuminate\Support\Facades\DB::table('yz_mini_template_corresponding')->where("template_name","提现到账通知")->update(["template_name"=>"提现成功通知"]);
  20. \Illuminate\Support\Facades\DB::table('yz_mini_template_corresponding')->where("template_name","直播审核结果通知")->update(["template_name"=>"审核结果通知"]);
  21. }
  22. }
  23. /**
  24. * Reverse the migrations.
  25. *
  26. * @return void
  27. */
  28. public function down()
  29. {
  30. //
  31. }
  32. }