|
@@ -54,7 +54,10 @@ class EmailComunications extends Component
|
|
|
$this->getCategories(\App\Models\Category::select('id', 'name')->where('parent_id', null)->orderBy('name')->get(), 0);
|
|
$this->getCategories(\App\Models\Category::select('id', 'name')->where('parent_id', null)->orderBy('name')->get(), 0);
|
|
|
|
|
|
|
|
$this->courses = [];
|
|
$this->courses = [];
|
|
|
- $this->getCourses(\App\Models\Course::select('id', 'name')->where('parent_id', null)->orderBy('name', 'ASC')->get(), 0);
|
|
|
|
|
|
|
+ $this->getCourses(\App\Models\Course::query()->where('parent_id', null)->orderBy('name', 'ASC')->get(), 0);
|
|
|
|
|
+ usort($this->courses, function($a, $b) {
|
|
|
|
|
+ return strcmp($a['name'], $b['name']);
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
$this->schedule_at = now($this->timezone)->addHour()->format('Y-m-d\TH:i');
|
|
$this->schedule_at = now($this->timezone)->addHour()->format('Y-m-d\TH:i');
|
|
|
}
|
|
}
|
|
@@ -70,7 +73,10 @@ class EmailComunications extends Component
|
|
|
$this->getCategories(\App\Models\Category::select('id', 'name')->where('parent_id', null)->orderBy('name')->get(), 0);
|
|
$this->getCategories(\App\Models\Category::select('id', 'name')->where('parent_id', null)->orderBy('name')->get(), 0);
|
|
|
|
|
|
|
|
$this->courses = [];
|
|
$this->courses = [];
|
|
|
- $this->getCourses(\App\Models\Course::select('id', 'name')->where('parent_id', null)->orderBy('name', 'ASC')->get(), 0);
|
|
|
|
|
|
|
+ $this->getCourses(\App\Models\Course::query()->where('parent_id', null)->orderBy('name', 'ASC')->get(), 0);
|
|
|
|
|
+ usort($this->courses, function($a, $b) {
|
|
|
|
|
+ return strcmp($a['name'], $b['name']);
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return view('livewire.email_comunications');
|
|
return view('livewire.email_comunications');
|
|
@@ -355,7 +361,8 @@ class EmailComunications extends Component
|
|
|
{
|
|
{
|
|
|
/** @var \App\Models\Course $record */
|
|
/** @var \App\Models\Course $record */
|
|
|
foreach ($records as $record) {
|
|
foreach ($records as $record) {
|
|
|
- $this->courses[] = array('id' => $record->id, 'name' => $record->getTree());
|
|
|
|
|
|
|
+ // $this->courses[] = array('id' => $record->id, 'name' => $record->getDetailsName());
|
|
|
|
|
+ $this->courses[] = array('id' => $record->id, 'name' => ($record->discipline?->name ? $record->discipline->name . ' - ' : '') . $record->name);
|
|
|
if (count($record->childs))
|
|
if (count($record->childs))
|
|
|
$this->getCourses($record->childs, $indentation + 1);
|
|
$this->getCourses($record->childs, $indentation + 1);
|
|
|
}
|
|
}
|