mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 06:46:08 -06:00
education sortable
This commit is contained in:
parent
9290c9951f
commit
ae29380e83
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Anomaly\Streams\Platform\Database\Migration\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class VisiosoftModuleProfileEducationSortable extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
$this->streams()
|
||||||
|
->findBySlugAndNamespace('education', 'profile')
|
||||||
|
->setAttribute('sortable', true)
|
||||||
|
->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
$this->streams()
|
||||||
|
->findBySlugAndNamespace('education', 'profile')
|
||||||
|
->setAttribute('sortable', false)
|
||||||
|
->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -6,6 +6,7 @@ use Anomaly\Streams\Platform\Model\Users\UsersUsersEntryModel;
|
|||||||
use Anomaly\UsersModule\User\Contract\UserRepositoryInterface;
|
use Anomaly\UsersModule\User\Contract\UserRepositoryInterface;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
use Visiosoft\AdvsModule\Adv\AdvModel;
|
use Visiosoft\AdvsModule\Adv\AdvModel;
|
||||||
use Visiosoft\AdvsModule\Adv\Event\ChangeStatusAd;
|
use Visiosoft\AdvsModule\Adv\Event\ChangeStatusAd;
|
||||||
use Visiosoft\AdvsModule\Status\Contract\StatusRepositoryInterface;
|
use Visiosoft\AdvsModule\Status\Contract\StatusRepositoryInterface;
|
||||||
@ -56,14 +57,16 @@ class MyProfileController extends PublicController
|
|||||||
compact('user', 'country', 'form', 'advs_count'));
|
compact('user', 'country', 'form', 'advs_count'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function detail(ProfileFormBuilder $form){
|
public function detail(ProfileFormBuilder $form)
|
||||||
$user = $this->userRepository->find(Auth::id());
|
{
|
||||||
$country = CountryModel::all();
|
$user = $this->userRepository->find(Auth::id());
|
||||||
return $this->view->make('visiosoft.module.profile::profile.detail', compact('user', 'country', 'form'));
|
$country = CountryModel::all();
|
||||||
|
return $this->view->make('visiosoft.module.profile::profile.detail', compact('user', 'country', 'form'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function password(){
|
public function password()
|
||||||
return $this->view->make('visiosoft.module.profile::profile.password');
|
{
|
||||||
|
return $this->view->make('visiosoft.module.profile::profile.password');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function extendAds($id, $type, SettingRepositoryInterface $settings)
|
public function extendAds($id, $type, SettingRepositoryInterface $settings)
|
||||||
@ -272,7 +275,18 @@ class MyProfileController extends PublicController
|
|||||||
public function changeEducation(Request $request)
|
public function changeEducation(Request $request)
|
||||||
{
|
{
|
||||||
if ($request->info == 'education') {
|
if ($request->info == 'education') {
|
||||||
$education = EducationPartModel::query()->where('education_id', $request->education)->get();
|
$education = DB::table('profile_education_part')
|
||||||
|
->leftJoin(
|
||||||
|
'profile_education_part_translations',
|
||||||
|
'profile_education_part.id',
|
||||||
|
'=',
|
||||||
|
'profile_education_part_translations.entry_id'
|
||||||
|
)
|
||||||
|
->where('profile_education_part_translations.locale', '=', Request()->session()->get('_locale', setting_value('streams::default_locale')))
|
||||||
|
->where('education_id', $request->education)
|
||||||
|
->selectRaw('default_profile_education_part.*, default_profile_education_part_translations.name as name')
|
||||||
|
->orderBy('name', 'ASC')
|
||||||
|
->get();
|
||||||
}
|
}
|
||||||
return response()->json(['data' => $education], 200);
|
return response()->json(['data' => $education], 200);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user