Browse Source

trim description whitespace

pull/3/head
Muhammad Sulaiman Yusuf 2 years ago
parent
commit
72661df9bf
  1. 8
      app/Http/Controllers/AssignMaterialController.php
  2. 1
      app/Http/Controllers/MaterialResourceController.php

8
app/Http/Controllers/AssignMaterialController.php

@ -120,7 +120,13 @@ class AssignMaterialController extends Controller
public function datatablesForReportActivity(Request $request){ public function datatablesForReportActivity(Request $request){
$id_activity = $request->query('idact'); $id_activity = $request->query('idact');
$data = AssignMaterial::select(AssignMaterial::raw('SUM(qty_planning) as qty_planning'), "m.description as material_name", "assign_material_to_activity.activity_id as activity_id") $data =
AssignMaterial::select(
AssignMaterial::raw(
'SUM(qty_planning) as qty_planning'),
"m.description as material_name",
"assign_material_to_activity.activity_id as activity_id"
)
->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")
->groupBy("m.description") ->groupBy("m.description")
->groupBy("assign_material_to_activity.activity_id") ->groupBy("assign_material_to_activity.activity_id")

1
app/Http/Controllers/MaterialResourceController.php

@ -18,6 +18,7 @@ class MaterialResourceController extends Controller
]); ]);
$data = $request->all(); $data = $request->all();
$data['description'] = trim($data['description']);
$data['created_by'] = $this->currentName; $data['created_by'] = $this->currentName;

Loading…
Cancel
Save