public function getModelIndicator($action, $id = NULL) { $model = 'indicator'; $array = []; if ($action == 'edit') { $indicator = \Solunes\Master\App\Indicator::find($id); $indicator_model = \FuncNode::node_check_model($indicator->node); $array['node_name'] = $indicator->node->plural; $array['filter_category'] = 'indicator'; $array['filter_node'] = $indicator->node->name; $array['filter_type'] = 'field'; $array['filter_category_id'] = $id; $filled_items = $indicator_model; $array = \AdminList::filter_node($array, $indicator->node, $indicator_model, $filled_items, 'indicator'); $array = \CustomFunc::custom_indicator($indicator->node, $indicator, $array); if (request()->has('search') && isset($array['filters']) && is_array($array['filters'])) { foreach ($array['filters'] as $field_name => $field) { $filter = \Solunes\Master\App\Filter::find($field['id']); $action_value = []; if ($field['subtype'] == 'date') { if (request()->has('f_' . $field_name . '_from')) { $action_value[request()->input('f_' . $field_name . '_from')] = 'is_greater'; } if (request()->has('f_' . $field_name . '_to')) { $action_value[request()->input('f_' . $field_name . '_to')] = 'is_less'; } } else { if ($field['subtype'] == 'string') { if (request()->has('f_' . $field_name)) { $action_value[request()->input('f_' . $field_name)] = request()->input('f_' . $field_name . '_action'); } } else { if (request()->has('f_' . $field_name) && is_array(request()->input('f_' . $field_name))) { foreach (request()->input('f_' . $field_name) as $subfield_key => $subfield_val) { $action_value[$subfield_val] = 'is'; } } else { if (request()->has('f_' . $field_name)) { $action_value[request()->input('f_' . $field_name)] = 'is'; } } } } $filter->action_value = json_encode($action_value); $filter->save(); } \CustomFunc::update_indicator_values($indicator); } $filled_items = $indicator_model; $array = \AdminList::filter_node($array, $indicator->node, $indicator_model, $filled_items, 'indicator'); $array['items'] = $array['items']->get(); } return AdminItem::get_request($model, $action, $id, $this, [], $array); }
/** * Run the database seeds. * * @return void */ public function run() { \Solunes\Master\App\ImageSize::truncate(); \Solunes\Master\App\ImageFolder::truncate(); \Solunes\Master\App\TempFile::truncate(); \Solunes\Master\App\VariableTranslation::truncate(); \Solunes\Master\App\Variable::truncate(); \Solunes\Master\App\InboxUser::truncate(); \Solunes\Master\App\InboxMessage::truncate(); \Solunes\Master\App\Inbox::truncate(); \Solunes\Master\App\Notification::truncate(); \Solunes\Master\App\Activity::truncate(); DB::table('permission_role')->truncate(); DB::table('role_user')->truncate(); \Solunes\Master\App\Role::truncate(); \Solunes\Master\App\Permission::truncate(); \App\User::truncate(); \Solunes\Master\App\EmailTranslation::truncate(); \Solunes\Master\App\Email::truncate(); \Solunes\Master\App\IndicatorValue::truncate(); \Solunes\Master\App\IndicatorGraph::truncate(); \Solunes\Master\App\IndicatorAlert::truncate(); \Solunes\Master\App\Indicator::truncate(); \Solunes\Master\App\FieldOptionTranslation::truncate(); \Solunes\Master\App\FieldOption::truncate(); \Solunes\Master\App\FieldConditional::truncate(); \Solunes\Master\App\FieldExtra::truncate(); \Solunes\Master\App\FieldTranslation::truncate(); \Solunes\Master\App\Field::truncate(); \Solunes\Master\App\Section::truncate(); \Solunes\Master\App\Filter::truncate(); \Solunes\Master\App\NodeExtra::truncate(); \Solunes\Master\App\NodeRequest::truncate(); \Solunes\Master\App\NodeTranslation::truncate(); \Solunes\Master\App\Node::truncate(); \Solunes\Master\App\MenuTranslation::truncate(); \Solunes\Master\App\Menu::truncate(); \Solunes\Master\App\PageTranslation::truncate(); \Solunes\Master\App\Page::truncate(); \Solunes\Master\App\SiteTranslation::truncate(); \Solunes\Master\App\Site::truncate(); \Solunes\Master\App\Language::truncate(); \App\PasswordReminder::truncate(); }