v.2.22
Редактор карты зала Электронные заказы Отчет по удалениям
This commit is contained in:
19
models/StaffRights.php
Normal file
19
models/StaffRights.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Component\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class StaffRights extends Model {
|
||||
protected $table = 'staff_rights';
|
||||
|
||||
public static function add($code, $name) {
|
||||
if (StaffRights::where('code', $code)->count() == 0) {
|
||||
$staffRight = new StaffRights([
|
||||
'code' => $code,
|
||||
'name' => $name,
|
||||
]);
|
||||
$staffRight->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user