Browse Source

Merge pull request 'staging upload 23-04-04' (#16) from staging into master

Reviewed-on: ordo/adw-backend#16
pull/3/head
ibnu 2 years ago
parent
commit
7f6f0a3f91
  1. 6
      app/Http/Controllers/HierarchyFtthController.php
  2. 5
      app/Http/Controllers/HumanResourceController.php
  3. 1
      routes/web.php

6
app/Http/Controllers/HierarchyFtthController.php

@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\HierarchyFtth;
use App\Models\VersionGantt;
class HierarchyFtthController extends Controller
{
@ -115,7 +116,12 @@ class HierarchyFtthController extends Controller
{
$finalData = [];
$data = HierarchyFtth::where('project_id', $project_id)->where('parent_id', $parent_id)->orderByRaw('id ASC')->get();
foreach($data as $objRow){
if (VersionGantt::where('hierarchy_ftth_id', $objRow->id)->exists()) {
$dataGantt = VersionGantt::where('hierarchy_ftth_id', $objRow->id)->get();
$objRow->dataGantt = $dataGantt;
}
$objRow->key = rand(1, 1000);
$objRow->children = $this->getChildren($project_id, $objRow->id);
$finalData[] = $objRow;

5
app/Http/Controllers/HumanResourceController.php

@ -6,6 +6,7 @@ use Illuminate\Http\Request;
use App\Models\HumanResource;
use App\Models\UserToActivity;
use App\Models\UserToProyek;
use Illuminate\Support\Facades\Artisan;
class HumanResourceController extends Controller
{
@ -170,4 +171,8 @@ class HumanResourceController extends Controller
return response()->json(['status'=>'failed','message'=>'old_password is required!','code'=>400], 400);
}
}
public function sync(){
Artisan::call('sync:integration-human-resources');
}
}

1
routes/web.php

@ -108,6 +108,7 @@ $router->group(['prefix'=>'api', 'middleware' => 'cors'], function () use ($rout
$router->get('/human-resource/list', 'HumanResourceController@list');
$router->get('/human-resource/select', 'HumanResourceController@select');
$router->post('/human-resource/check-old-password/{id}', 'HumanResourceController@checkOldPassword');
$router->get('/human-resource/sync', 'HumanResourceController@sync');
$router->post('/project-role/search', 'ProjectRoleController@search');
$router->post('/project-role/add', 'ProjectRoleController@add');

Loading…
Cancel
Save