@ -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")