|
|
|
@ -4,6 +4,7 @@ namespace App\Http\Controllers\Admin;
|
|
|
|
|
|
|
|
|
|
|
|
use App\Models\Study;
|
|
|
|
use App\Models\Study;
|
|
|
|
use App\Models\StudyAsk;
|
|
|
|
use App\Models\StudyAsk;
|
|
|
|
|
|
|
|
use App\Models\StudyLog;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
use Illuminate\Support\Facades\Validator;
|
|
|
|
use Illuminate\Support\Facades\Validator;
|
|
|
|
use App\Helpers\ResponseCode;
|
|
|
|
use App\Helpers\ResponseCode;
|
|
|
|
@ -44,6 +45,36 @@ class StudyController extends CommonController
|
|
|
|
return $this->success($list);
|
|
|
|
return $this->success($list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @OA\Get(
|
|
|
|
|
|
|
|
* path="/api/admin/study/study-log",
|
|
|
|
|
|
|
|
* tags={"学习资料管理"},
|
|
|
|
|
|
|
|
* summary="学习记录",
|
|
|
|
|
|
|
|
* description="",
|
|
|
|
|
|
|
|
* @OA\Parameter(name="keyword", in="query", @OA\Schema(type="string"), required=false, description="关键词"),
|
|
|
|
|
|
|
|
* @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\Response(
|
|
|
|
|
|
|
|
* response="200",
|
|
|
|
|
|
|
|
* description="暂无"
|
|
|
|
|
|
|
|
* )
|
|
|
|
|
|
|
|
* )
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public function studyLog()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$all = request()->all();
|
|
|
|
|
|
|
|
$list = StudyLog::with('user')->where(function ($query) use ($all) {
|
|
|
|
|
|
|
|
if (isset($all['keyword'])) {
|
|
|
|
|
|
|
|
$query->where('content', 'like', '%' . $all['keyword'] . '%');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})->orderBy($all['sort_name'] ?? 'id', $all['sort_type'] ?? 'desc')
|
|
|
|
|
|
|
|
->paginate($all['page_size'] ?? 20);
|
|
|
|
|
|
|
|
return $this->success($list);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @OA\Get(
|
|
|
|
* @OA\Get(
|
|
|
|
* path="/api/admin/study/show",
|
|
|
|
* path="/api/admin/study/show",
|
|
|
|
|