Browse Source

make new end point for project-cost

pull/1/head
farhantock 1 year ago
parent
commit
a69c983027
  1. 11
      app/Http/Controllers/ProjectController.php
  2. 1
      routes/web.php

11
app/Http/Controllers/ProjectController.php

@ -760,6 +760,17 @@ class ProjectController extends Controller
return response()->json(['status' => 'success', 'code' => 200, 'data' => $data], 200);
}
public function getProjectCostIntegration($name)
{
$search = urlencode($name);
if (empty($search))
return response()->json(['status' => 'error', 'message' => 'Empty query string!'], 400);
$url = str_replace("SEARCH", $search, config('api.adw') . '/project_cost?project_no=SEARCH');
$response = MasterFunctionsHelper::curlReq($url);
return response()->json(['status' => 'success', 'data' => $response, 'code' => 200], 200);
}
private function httpReq($search)
{
$ch = curl_init();

1
routes/web.php

@ -74,6 +74,7 @@ $router->group(['prefix' => 'api', 'middleware' => 'cors'], function () use ($ro
$router->post('/project/get-overdue-activities', 'ProjectController@getOverdueActivities');
$router->post('/project/get-integration-invoice', 'ProjectController@getInvoiceIntegration');
$router->post('/project/get-report-distribution', 'ProjectController@getReportDistribution');
$router->get('/project/get-integration-project-cost={name}', 'ProjectController@getProjectCostIntegration');
/* $router->get('/project/get-expenditure/{id}/{date?}', 'ProjectController@getExpenditure'); */

Loading…
Cancel
Save