mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
feat wiki/ayuda section
This commit is contained in:
@ -4,102 +4,162 @@ namespace App\Database\Seeds;
|
||||
|
||||
use App\Models\Configuracion\ConfigVariableModel;
|
||||
use App\Models\Wiki\WikiSectionModel;
|
||||
use App\Models\Wiki\WikiSectionRoleModel;
|
||||
use CodeIgniter\Database\Seeder;
|
||||
|
||||
class WikiSectionSeeder extends Seeder
|
||||
{
|
||||
protected array $dataAdmin = [
|
||||
[
|
||||
"name" => 'Introducción',
|
||||
"slug" => 'intro-admin',
|
||||
"icon" => 'ti ti-home-2'
|
||||
[
|
||||
"name" => 'Introducción',
|
||||
"slug" => 'intro-admin',
|
||||
"icon" => 'ti ti-home-2',
|
||||
"roles" => [
|
||||
"admin",
|
||||
],
|
||||
[
|
||||
"name" => 'Presupuesto',
|
||||
"slug" => 'presupuesto-admin',
|
||||
"icon" => 'ti ti-currency-dollar'
|
||||
],
|
||||
[
|
||||
"name" => 'Presupuesto',
|
||||
"slug" => 'presupuesto-admin',
|
||||
"icon" => 'ti ti-currency-dollar',
|
||||
"roles" => [
|
||||
"admin",
|
||||
],
|
||||
],
|
||||
[
|
||||
"name" => 'Pedidos',
|
||||
"slug" => 'pedidos-admin',
|
||||
"icon" => 'ti ti-file-description',
|
||||
"roles" => [
|
||||
"admin",
|
||||
],
|
||||
[
|
||||
"name" => 'Pedidos',
|
||||
"slug" => 'pedidos-admin',
|
||||
"icon" => 'ti ti-file-description'
|
||||
|
||||
],
|
||||
[
|
||||
"name" => 'Facturación',
|
||||
"slug" => 'facturacion-admin',
|
||||
"icon" => 'ti ti-file-dollar',
|
||||
"roles" => [
|
||||
"admin",
|
||||
],
|
||||
[
|
||||
"name" => 'Facturación',
|
||||
"slug" => 'facturacion-admin',
|
||||
"icon" => 'ti ti-file-dollar'
|
||||
|
||||
],
|
||||
[
|
||||
"name" => 'Logística',
|
||||
"slug" => 'logistica-admin',
|
||||
"icon" => 'ti ti-truck',
|
||||
"roles" => [
|
||||
"admin",
|
||||
],
|
||||
[
|
||||
"name" => 'Logística',
|
||||
"slug" => 'logistica-admin',
|
||||
"icon" => 'ti ti-truck'
|
||||
|
||||
],
|
||||
[
|
||||
"name" => 'Tarifas',
|
||||
"slug" => 'tarifas-admin',
|
||||
"icon" => 'ti ti-receipt',
|
||||
"roles" => [
|
||||
"admin",
|
||||
],
|
||||
[
|
||||
"name" => 'Tarifas',
|
||||
"slug" => 'tarifas-admin',
|
||||
"icon" => 'ti ti-receipt'
|
||||
|
||||
],
|
||||
[
|
||||
"name" => 'Configuración',
|
||||
"slug" => 'config-admin',
|
||||
"icon" => 'ti ti-adjustments-horizontal',
|
||||
"roles" => [
|
||||
"admin",
|
||||
],
|
||||
[
|
||||
"name" => 'Configuración',
|
||||
"slug" => 'config-admin',
|
||||
"icon" => 'ti ti-adjustments-horizontal'
|
||||
|
||||
],
|
||||
[
|
||||
"name" => 'Mensajería',
|
||||
"slug" => 'messages-admin',
|
||||
"icon" => 'ti ti-message',
|
||||
"roles" => [
|
||||
"admin",
|
||||
],
|
||||
[
|
||||
"name" => 'Mensajería',
|
||||
"slug" => 'messages-admin',
|
||||
"icon" => 'ti ti-message'
|
||||
|
||||
]
|
||||
]
|
||||
];
|
||||
protected array $dataCliente = [
|
||||
[
|
||||
"name" => 'Introducción',
|
||||
"slug" => 'intro-cliente',
|
||||
"icon" => 'ti ti-home-2',
|
||||
"roles" => [
|
||||
"cliente-admin",
|
||||
"cliente-editor",
|
||||
]
|
||||
],
|
||||
[
|
||||
"name" => 'Presupuesto(Cliente)',
|
||||
"slug" => 'presupuesto-cliente',
|
||||
"role" => 'cliente',
|
||||
"icon" => 'ti ti-currency-dollar',
|
||||
"role" => 'cliente',
|
||||
"roles" => [
|
||||
"cliente-admin",
|
||||
"cliente-editor",
|
||||
]
|
||||
],
|
||||
[
|
||||
"name" => 'Pedidos(Cliente)',
|
||||
"slug" => 'pedidos-cliente',
|
||||
"icon" => 'ti ti-file-description',
|
||||
"role" => 'cliente',
|
||||
"roles" => [
|
||||
"cliente-admin",
|
||||
"cliente-editor",
|
||||
]
|
||||
],
|
||||
[
|
||||
"name" => 'Facturación (Cliente)',
|
||||
"slug" => 'facturacion-cliente',
|
||||
"icon" => 'ti ti-file-dollar',
|
||||
"role" => 'cliente',
|
||||
"roles" => [
|
||||
"cliente-admin",
|
||||
"cliente-editor",
|
||||
]
|
||||
],
|
||||
[
|
||||
"name" => 'Tarifas (Cliente)',
|
||||
"slug" => 'tarifas-cliente',
|
||||
"icon" => 'ti ti-receipt',
|
||||
"role" => 'cliente',
|
||||
"roles" => [
|
||||
"cliente-admin",
|
||||
"cliente-editor",
|
||||
]
|
||||
],
|
||||
[
|
||||
"name" => 'Mensajería (Cliente)',
|
||||
"slug" => 'messages-cliente',
|
||||
"icon" => 'ti ti-message',
|
||||
"role" => 'cliente',
|
||||
"roles" => [
|
||||
"cliente-admin",
|
||||
"cliente-editor",
|
||||
]
|
||||
]
|
||||
];
|
||||
];
|
||||
public function run()
|
||||
{
|
||||
|
||||
$wikiSectionModel = model(WikiSectionModel::class);
|
||||
$wikiSectionRoleModel = model(WikiSectionRoleModel::class);
|
||||
$section_order = 0;
|
||||
foreach ($this->dataAdmin as $key => $row) {
|
||||
# code...
|
||||
$wikiSectionModel->insert($row);
|
||||
$row['order'] = $section_order;
|
||||
$wikiSectionId = $wikiSectionModel->insert($row);
|
||||
$section_order++;
|
||||
foreach ($row['roles'] as $key => $role) {
|
||||
$wikiSectionRoleModel->insert(['wiki_section_id' => $wikiSectionId,"role" => $role]);
|
||||
|
||||
}
|
||||
}
|
||||
foreach ($this->dataCliente as $key => $row) {
|
||||
# code...
|
||||
$wikiSectionModel->insert($row);
|
||||
$row['order'] = $section_order;
|
||||
$wikiSectionId = $wikiSectionModel->insert($row);
|
||||
$section_order++;
|
||||
foreach ($row['roles'] as $key => $role) {
|
||||
$wikiSectionRoleModel->insert(['wiki_section_id' => $wikiSectionId,"role" => $role]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user