drvkf88226 2019-08-06 05:31
浏览 64

使用php循环在laravel中将数据显示为交叉表

Hello there i am working with laravel 5.7 and facing an issue related to crosstab results displaying i mean that i can get result like the result image.

Please have a look at the below link then you will understand what i wanna achieve

https://webmasters.stackexchange.com/questions/124278/display-data-as-cross-tab-in-laravel

I have spent almost 7 days but could not found any proper solution please help me out i will be thankful to you

Thanks in advance.

I have join

$degreesPdfs  = DB::table('student_tbs')
    ->join('roll_no_tbs','roll_no_tbs.regno','=','student_tbs.regno')
    ->join('roll_no_com_dets','roll_no_com_dets.rollno','=','roll_no_tbs.rollno')
    ->join('college_tbs','college_tbs.college_id','student_tbs.department_id')
    ->leftjoin('subject_tbs','subject_tbs.code','=','roll_no_com_dets.subcode')
    ->leftjoin('dbo_web_part','dbo_web_part.part','=','roll_no_tbs.part')
    ->select('student_tbs.student_id','student_tbs.regno','student_tbs.stdName',
        'student_tbs.stdfName','student_tbs.department_id','student_tbs.degree_id',
        'roll_no_tbs.rollno','roll_no_com_dets.subcode','roll_no_com_dets.obt40',
        'subject_tbs.Na','subject_tbs.semester_id','subject_tbs.hours','college_tbs.name',
        'dbo_web_part.P_name','dbo_web_part.OneRTwo')
    ->where(['student_tbs.department_id' => $degAdmin_department,
        'student_tbs.degree_id' => $degree])
    ->distinct(['roll_no_com_dets.subcode','student_tbs.regno'])
    ->groupBy('dbo_web_part.OneRTwo')
    ->orderBy('roll_no_com_dets.rollno')
    ->get();
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?