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 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
    • ¥50 成都蓉城足球俱乐部小程序抢票
    • ¥15 yolov7训练自己的数据集
    • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
    • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
    • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)