|
|
|
@ -3,6 +3,7 @@ namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
|
|
use App\Helpers\MasterFunctionsHelper; |
|
|
|
|
use App\Models\Activity; |
|
|
|
|
use App\Models\AssignMaterial; |
|
|
|
|
use App\Models\CommentActivity; |
|
|
|
|
use App\Models\Link; |
|
|
|
|
use App\Models\Project; |
|
|
|
@ -422,7 +423,14 @@ class ActivityController extends Controller
|
|
|
|
|
return response()->json(['status' => 'failed', 'message' => 'Activities not found!', 'code' => 404], 404); |
|
|
|
|
$duration = 0; |
|
|
|
|
foreach ($activities as $key => $activity) { |
|
|
|
|
if (isset($activity->planned_start) && isset($activity->planned_end)) { |
|
|
|
|
$assignMaterial = AssignMaterial::where('activity_id', $activity->id)->first(); |
|
|
|
|
if (isset($assignMaterial)) { |
|
|
|
|
$statusActivity = $assignMaterial->status_activity; |
|
|
|
|
} else { |
|
|
|
|
$statusActivity = ''; |
|
|
|
|
} |
|
|
|
|
if (isset($activity->planned_start) && isset($activity->planned_end) && $statusActivity != "done") { |
|
|
|
|
// todo check report for no report / progress == 0 |
|
|
|
|
$today = new DateTime(); |
|
|
|
|
$endDate = new DateTime($activity->end_date); |
|
|
|
|
$startDate = new DateTime($activity->start_date); |
|
|
|
|