|
|
|
|
@ -17,6 +17,7 @@ use App\Models\CustomForm;
|
|
|
|
|
use App\Models\CustomFormField;
|
|
|
|
|
use App\Models\EmailTemplate;
|
|
|
|
|
use App\Models\SupplyDemand;
|
|
|
|
|
use App\Models\Teacher;
|
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
use Illuminate\Support\Facades\Validator;
|
|
|
|
|
use Maatwebsite\Excel\Facades\Excel;
|
|
|
|
|
@ -58,7 +59,31 @@ class CompanyController extends BaseController
|
|
|
|
|
});
|
|
|
|
|
$companiesTags = array_values($companiesTags);
|
|
|
|
|
|
|
|
|
|
return $this->success(compact('companiesTags'));
|
|
|
|
|
// 课程方向(从teachers表的direction字段获取并去重)
|
|
|
|
|
$teacherDirections = Teacher::whereNotNull('direction')
|
|
|
|
|
->where('direction', '!=', '')
|
|
|
|
|
->pluck('direction')
|
|
|
|
|
->toArray();
|
|
|
|
|
|
|
|
|
|
$allDirections = [];
|
|
|
|
|
foreach ($teacherDirections as $direction) {
|
|
|
|
|
if (!empty($direction)) {
|
|
|
|
|
// 将逗号分隔的字符串拆分成数组
|
|
|
|
|
$directions = explode(',', $direction);
|
|
|
|
|
foreach ($directions as $dir) {
|
|
|
|
|
$dir = trim($dir);
|
|
|
|
|
if (!empty($dir)) {
|
|
|
|
|
$allDirections[] = $dir;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 去重并重新索引
|
|
|
|
|
$directions = array_values(array_unique($allDirections));
|
|
|
|
|
// 排序
|
|
|
|
|
sort($directions);
|
|
|
|
|
|
|
|
|
|
return $this->success(compact('companiesTags', 'directions'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|