|
|
@@ -1,5 +1,6 @@
|
|
|
<?php
|
|
|
|
|
|
+use App\Authority;
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
@@ -7,7 +8,8 @@ use Illuminate\Support\Facades\Schema;
|
|
|
class AddInventoryAuthority extends Migration
|
|
|
{
|
|
|
protected $authNames=[
|
|
|
- "库存管理"
|
|
|
+ "库存管理",
|
|
|
+ "库存管理-动库报表"
|
|
|
];
|
|
|
/**
|
|
|
* Run the migrations.
|
|
|
@@ -16,7 +18,9 @@ class AddInventoryAuthority extends Migration
|
|
|
*/
|
|
|
public function up()
|
|
|
{
|
|
|
- //
|
|
|
+ foreach ($this->authNames as $name){
|
|
|
+ if(!Authority::where('name',$name)->first())(new Authority(['name'=>$name,'alias_name'=>$name]))->save();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -26,6 +30,8 @@ class AddInventoryAuthority extends Migration
|
|
|
*/
|
|
|
public function down()
|
|
|
{
|
|
|
- //
|
|
|
+ foreach ($this->authNames as $name){
|
|
|
+ Authority::where('name',$name)->delete();
|
|
|
+ }
|
|
|
}
|
|
|
}
|