master
cody 5 months ago
parent 6fab6e2757
commit 7dfcbff291

@ -146,12 +146,6 @@ class CourseContentController extends BaseController
* @OA\Parameter(name="teacher_id", in="query", @OA\Schema(type="integer"), description="老师ID"), * @OA\Parameter(name="teacher_id", in="query", @OA\Schema(type="integer"), description="老师ID"),
* @OA\Parameter(name="address", in="query", @OA\Schema(type="string"), description="地址"), * @OA\Parameter(name="address", in="query", @OA\Schema(type="string"), description="地址"),
* @OA\Parameter(name="theme", in="query", @OA\Schema(type="string"), description="主题"), * @OA\Parameter(name="theme", in="query", @OA\Schema(type="string"), description="主题"),
* @OA\Parameter(name="course_content_evaluation_title", in="query", @OA\Schema(type="string"), description="问卷标题"),
* @OA\Parameter(name="course_content_evaluation_desc", in="query", @OA\Schema(type="string"), description="问卷描述"),
* @OA\Parameter(name="course_content_evaluation_type_id", in="query", @OA\Schema(type="string"), description="问卷类型id"),
* @OA\Parameter(name="course_content_evaluation_start_time", in="query", @OA\Schema(type="string"), description="问卷开始时间"),
* @OA\Parameter(name="course_content_evaluation_end_time", in="query", @OA\Schema(type="string"), description="问卷结束时间"),
* @OA\Parameter(name="course_content_evaluation_status", in="query", @OA\Schema(type="string"), description="问卷状态0未发布1已发布"),
* @OA\Response( * @OA\Response(
* response=200, * response=200,
* description="操作成功" * description="操作成功"

@ -92,14 +92,19 @@ class CourseContentEvaluationAskController extends BaseController
* summary="保存", * summary="保存",
* description="", * description="",
* @OA\Parameter(name="id", in="query", @OA\Schema(type="integer", format="int64"), required=true, description="课程内容评价字段ID存在则更新不存在则新增"), * @OA\Parameter(name="id", in="query", @OA\Schema(type="integer", format="int64"), required=true, description="课程内容评价字段ID存在则更新不存在则新增"),
* @OA\Parameter(name="course_content_id", in="query", @OA\Schema(type="integer", format="int32"), required=true, description="课程排课ID"), * @OA\Parameter(name="course_id", in="query", @OA\Schema(type="integer"), required=false, description="课程ID"),
* @OA\Parameter(name="title", in="query", @OA\Schema(type="string"), required=true, description="标题"), * @OA\Parameter(name="course_content_id", in="query", @OA\Schema(type="integer"), required=false, description="课程排课ID"),
* @OA\Parameter(name="type", in="query", @OA\Schema(type="string"), required=true, description="字段类型。单选radio多选checkbox问答text评分number日期date日期时间datetime"), * @OA\Parameter(name="course_content_evaluation_id", in="query", @OA\Schema(type="integer"), required=false, description="评价问卷ID"),
* @OA\Parameter(name="key", in="query", @OA\Schema(type="string"), required=true, description="英文标识"), * @OA\Parameter(name="name", in="query", @OA\Schema(type="string"), required=false, description="字段名字"),
* @OA\Parameter(name="remark", in="query", @OA\Schema(type="string"), required=false, description="备注"), * @OA\Parameter(name="field", in="query", @OA\Schema(type="string"), required=false, description="字段英文标识"),
* @OA\Parameter(name="sort", in="query", @OA\Schema(type="integer", format="int32"), required=false, description="排序"), * @OA\Parameter(name="edit_input", in="query", @OA\Schema(type="string", maxLength=50), required=false, description="编辑框类型"),
* @OA\Parameter(name="options", in="query", @OA\Schema(type="string"), required=false, description="选项,以英文逗号分隔"), * @OA\Parameter(name="rule", in="query", @OA\Schema(type="string"), required=false, description="检测规则"),
* @OA\Parameter(name="allow_input", in="query", @OA\Schema(type="string"), required=false, description="是否支持自行输入0否1是"), * @OA\Parameter(name="sort", in="query", @OA\Schema(type="integer", default=1), required=false, description="排序"),
* @OA\Parameter(name="help", in="query", @OA\Schema(type="string"), required=false, description="帮助文字"),
* @OA\Parameter(name="select_item", in="query", @OA\Schema(type="object", format="json"), required=false, description="下拉框选项JSON格式"),
* @OA\Parameter(name="need_fill", in="query", @OA\Schema(type="boolean", default=0), required=false, description="是否需要填写0: 否, 1: 是)"),
* @OA\Parameter(name="belong_user", in="query", @OA\Schema(type="boolean", default=0), required=false, description="是否属于用户信息0: 否, 1: 是)"),
* @OA\Parameter(name="allow_input", in="query", @OA\Schema(type="boolean", default=0), required=false, description="是否支持自行录入0: 否, 1: 是)"),
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="认证token"), * @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="认证token"),
* @OA\Response( * @OA\Response(
* response="200", * response="200",

@ -0,0 +1,135 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Exports\BaseExport;
use App\Helpers\ResponseCode;
use App\Models\AppointmentType;
use App\Models\Book;
use App\Models\CourseContentEvaluation;
use App\Models\CourseContentEvaluationAsk;
use App\Models\CustomForm;
use App\Models\CustomFormField;
use App\Models\SupplyDemand;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;
use Maatwebsite\Excel\Facades\Excel;
use Rap2hpoutre\FastExcel\FastExcel;
class CourseContentEvaluationsController extends BaseController
{
/**
* 构造函数
*/
public function __construct()
{
parent::__construct(new CourseContentEvaluation());
}
/**
* @OA\Get(
* path="/api/admin/course-content-evaluations/index",
* tags={"问卷管理"},
* summary="列表",
* description="",
* @OA\Parameter(name="is_export", in="query", @OA\Schema(type="string"), required=false, description="是否导出0否1是"),
* @OA\Parameter(name="export_fields", in="query", @OA\Schema(type="string"), required=false, description="需要导出的字段数组"),
* @OA\Parameter(name="filter", in="query", @OA\Schema(type="string"), required=false, description="查询条件。数组"),
* @OA\Parameter(name="show_relation", in="query", @OA\Schema(type="string"), required=false, description="需要输出的关联关系数组包括teachercourseSettingscoursePeriods"),
* @OA\Parameter(name="page_size", in="query", @OA\Schema(type="string"), required=false, description="每页显示的条数"),
* @OA\Parameter(name="page", in="query", @OA\Schema(type="string"), required=false, description="页码"),
* @OA\Parameter(name="sort_name", in="query", @OA\Schema(type="string"), required=false, description="排序字段名字"),
* @OA\Parameter(name="sort_type", in="query", @OA\Schema(type="string"), required=false, description="排序类型"),
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
* @OA\Parameter(name="keyword", in="query", @OA\Schema(type="string"), required=true, description="关键词"),
* @OA\Response(
* response="200",
* description="暂无"
* )
* )
*/
public function index()
{
return parent::index();
}
/**
* @OA\Get(
* path="/api/admin/course-content-evaluations/show",
* tags={"问卷管理"},
* summary="详情",
* description="",
* @OA\Parameter(name="id", in="query", @OA\Schema(type="string"), required=true, description="id"),
* @OA\Parameter(name="show_relation", in="query", @OA\Schema(type="string"), required=false, description="需要输出的关联关系数组,填写输出指定数据"),
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
* @OA\Response(
* response="200",
* description="暂无"
* )
* )
*/
public function show()
{
$all = \request()->all();
$messages = [
'id.required' => 'Id必填',
];
$validator = Validator::make($all, [
'id' => 'required'
], $messages);
if ($validator->fails()) {
return $this->fail([ResponseCode::ERROR_PARAMETER, implode(',', $validator->errors()->all())]);
}
$detail = $this->model->find($all['id']);
return $this->success($detail);
}
/**
* @OA\Post(
* path="/api/admin/course-content-evaluations/save",
* tags={"问卷管理"},
* summary="保存",
* description="",
* @OA\Parameter(name="id", in="query", @OA\Schema(type="integer", format="int64"), required=true, description="课程内容评价字段ID存在则更新不存在则新增"),
* @OA\Parameter(name="course_id", in="query", @OA\Schema(type="integer"), required=false, description="课程ID"),
* @OA\Parameter(name="course_content_id", in="query", @OA\Schema(type="integer"), required=false, description="课程内容ID"),
* @OA\Parameter(name="title", in="query", @OA\Schema(type="string", maxLength=255), required=false, description="问卷标题"),
* @OA\Parameter(name="desc", in="query", @OA\Schema(type="string", maxLength=255), required=false, description="问卷描述"),
* @OA\Parameter(name="type_id", in="query", @OA\Schema(type="string", maxLength=255), required=false, description="问卷类型ID"),
* @OA\Parameter(name="start_time", in="query", @OA\Schema(type="string", maxLength=255), required=false, description="问卷开始时间"),
* @OA\Parameter(name="end_time", in="query", @OA\Schema(type="string", maxLength=255), required=false, description="问卷截止时间"),
* @OA\Parameter(name="status", in="query", @OA\Schema(type="string", maxLength=255, default="0"), required=false, description="问卷状态0未发布1已发布"),
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="认证token"),
* @OA\Response(
* response="200",
* description="操作成功"
* )
* )
*/
public function save()
{
return parent::save();
}
/**
* @OA\Get(
* path="/api/admin/course-content-evaluations/destroy",
* tags={"问卷管理"},
* summary="删除",
* description="",
* @OA\Parameter(name="id", in="query", @OA\Schema(type="string"), required=true, description="id"),
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
* @OA\Response(
* response="200",
* description="暂无"
* )
* )
*/
public function destroy()
{
return parent::destroy();
}
}

@ -0,0 +1,8 @@
<?php
namespace App\Models;
class CourseContentEvaluation extends SoftDeletesModel
{
}

@ -14,19 +14,20 @@ return new class extends Migration {
{ {
Schema::create('course_content_evaluation_asks', function (Blueprint $table) { Schema::create('course_content_evaluation_asks', function (Blueprint $table) {
$table->id(); $table->id();
$table->integer('admin_id')->nullable();
$table->integer('department_id')->nullable();
$table->integer('course_id')->nullable()->comment('课程id');
$table->integer('course_content_id')->nullable()->comment('课程排课id'); $table->integer('course_content_id')->nullable()->comment('课程排课id');
// 字段名字 $table->integer('course_content_evaluation_id')->nullable()->comment('评价问卷id');
$table->string('title')->nullable()->comment('标题'); $table->string('name')->nullable()->comment('字段名字');
// 字段类型 $table->string('field')->nullable()->comment('字段英文标识');
$table->string('type')->nullable()->comment('字段类型。单选radio多选checkbox问答text评分number日期date日期时间datetime'); $table->string('edit_input', 50)->comment('编辑框类型');
// 英文标识 $table->string('rule')->nullable()->comment('检测规则');
$table->string('key')->nullable()->comment('英文标识'); $table->integer('sort')->default(1)->nullable()->comment('排序');
// 备注 $table->string('help')->nullable()->comment('帮助文字');
$table->string('remark')->nullable()->comment('备注'); $table->json('select_item')->nullable()->comment('下拉框选项');
// 排序 $table->boolean('need_fill')->default(0)->nullable()->comment('是否需要填写');
$table->integer('sort')->nullable()->comment('排序'); $table->boolean('belong_user')->default(0)->nullable()->comment('是否属于用户信息');
// 选项
$table->string('options')->nullable()->comment('选项');
// 是否支持自行录入 // 是否支持自行录入
$table->boolean('allow_input')->nullable()->default(0)->comment('是否支持自行录入'); $table->boolean('allow_input')->nullable()->default(0)->comment('是否支持自行录入');
$table->timestamps(); $table->timestamps();

@ -14,6 +14,8 @@ return new class extends Migration {
{ {
Schema::create('course_content_evaluations', function (Blueprint $table) { Schema::create('course_content_evaluations', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('course_id')->nullable()->comment('课程id');
$table->string('course_content_id')->nullable()->comment('课程内容id');
$table->string('title')->nullable()->comment('问卷标题'); $table->string('title')->nullable()->comment('问卷标题');
// 问卷描述 // 问卷描述
$table->string('desc')->nullable()->comment('问卷描述'); $table->string('desc')->nullable()->comment('问卷描述');

@ -180,6 +180,12 @@ Route::group(["namespace" => "Admin", "prefix" => "admin"], function () {
Route::post('book/excel-show', [\App\Http\Controllers\Admin\BookController::class, "excelShow"]); Route::post('book/excel-show', [\App\Http\Controllers\Admin\BookController::class, "excelShow"]);
Route::post('book/import', [\App\Http\Controllers\Admin\BookController::class, "import"]); Route::post('book/import', [\App\Http\Controllers\Admin\BookController::class, "import"]);
// 课程评价问卷
Route::get('course-content-evaluations/index', [\App\Http\Controllers\Admin\CourseContentEvaluationsController::class, "index"]);
Route::get('course-content-evaluations/show', [\App\Http\Controllers\Admin\CourseContentEvaluationsController::class, "show"]);
Route::post('course-content-evaluations/save', [\App\Http\Controllers\Admin\CourseContentEvaluationsController::class, "save"]);
Route::get('course-content-evaluations/destroy', [\App\Http\Controllers\Admin\CourseContentEvaluationsController::class, "destroy"]);
// 课程评价设置 // 课程评价设置
Route::get('course-content-evaluation-ask/index', [\App\Http\Controllers\Admin\CourseContentEvaluationAskController::class, "index"]); Route::get('course-content-evaluation-ask/index', [\App\Http\Controllers\Admin\CourseContentEvaluationAskController::class, "index"]);
Route::get('course-content-evaluation-ask/show', [\App\Http\Controllers\Admin\CourseContentEvaluationAskController::class, "show"]); Route::get('course-content-evaluation-ask/show', [\App\Http\Controllers\Admin\CourseContentEvaluationAskController::class, "show"]);

Loading…
Cancel
Save