Browse Source

update report activity

pull/1/head
wahyu 11 months ago
parent
commit
cd2101a108
  1. 6
      app/Http/Controllers/ReportActivityMaterialController.php

6
app/Http/Controllers/ReportActivityMaterialController.php

@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use App\Helpers\MasterFunctionsHelper; use App\Helpers\MasterFunctionsHelper;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use App\Models\ReportActivityMaterial; use App\Models\ReportActivityMaterial;
use App\Models\Activity; use App\Models\Activity;
use App\Models\AssignMaterial; use App\Models\AssignMaterial;
@ -132,6 +133,7 @@ class ReportActivityMaterialController extends Controller
public function datatables(Request $request){ public function datatables(Request $request){
$id_activity = $request->query('idAct'); $id_activity = $request->query('idAct');
$id_am = $request->query('idAmi');
$type = $request->query('type'); $type = $request->query('type');
$materialName = $request->query('materialName'); $materialName = $request->query('materialName');
if($type == 'plan'){ if($type == 'plan'){
@ -143,7 +145,7 @@ class ReportActivityMaterialController extends Controller
$data = AssignMaterial::select("assign_material_to_activity.*","m.description as material_name", "m.uom as uom") $data = AssignMaterial::select("assign_material_to_activity.*","m.description as material_name", "m.uom as uom")
->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id") ->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id")
->where('assign_material_to_activity.activity_id', $id_activity) ->where('assign_material_to_activity.activity_id', $id_activity)
->where('m.description', 'LIKE', '%' . $materialName . '%') ->where('assign_material_to_activity.id', $id_am)
->orderBy('assign_material_to_activity.id', 'asc') ->orderBy('assign_material_to_activity.id', 'asc')
->get(); ->get();
if ($baselineDuration > 0) { if ($baselineDuration > 0) {
@ -172,7 +174,7 @@ class ReportActivityMaterialController extends Controller
->join("m_req_material as m", "m.id", "=", "amta.material_id") ->join("m_req_material as m", "m.id", "=", "amta.material_id")
->join("m_users as u", "u.id", "=", "report_activity_material.user_id") ->join("m_users as u", "u.id", "=", "report_activity_material.user_id")
->where('report_activity_material.activity_id', $id_activity) ->where('report_activity_material.activity_id', $id_activity)
->where('m.description', 'LIKE', '%' . $materialName . '%') ->where('report_activity_material.assign_material_id', $id_am)
->orderBy('report_activity_material.report_date', 'asc') ->orderBy('report_activity_material.report_date', 'asc')
->get(); ->get();
if ($baselineDuration > 0) { if ($baselineDuration > 0) {

Loading…
Cancel
Save