Browse Source

Merge pull request 'dev-wahyu' (#290) from dev-wahyu into staging

Reviewed-on: ordo/adw-backend#290
pull/1/head
ibnu 11 months ago
parent
commit
3347366c81
  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 Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use App\Models\ReportActivityMaterial;
use App\Models\Activity;
use App\Models\AssignMaterial;
@ -132,6 +133,7 @@ class ReportActivityMaterialController extends Controller
public function datatables(Request $request){
$id_activity = $request->query('idAct');
$id_am = $request->query('idAmi');
$type = $request->query('type');
$materialName = $request->query('materialName');
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")
->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id")
->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')
->get();
if ($baselineDuration > 0) {
@ -172,7 +174,7 @@ class ReportActivityMaterialController extends Controller
->join("m_req_material as m", "m.id", "=", "amta.material_id")
->join("m_users as u", "u.id", "=", "report_activity_material.user_id")
->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')
->get();
if ($baselineDuration > 0) {

Loading…
Cancel
Save