Browse Source

gantt column by type

pull/3/head
Muhammad Sulaiman Yusuf 2 years ago
parent
commit
ca9c6488f7
  1. 11
      app/Http/Controllers/ShowHideColumnController.php
  2. 10
      app/Models/GanttColumnByType.php
  3. 1
      routes/web.php

11
app/Http/Controllers/ShowHideColumnController.php

@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Models\UserToVersionGantt; use App\Models\UserToVersionGantt;
use App\Models\ShowHideColumn; use App\Models\ShowHideColumn;
use App\Models\GanttColumnByType;
class ShowHideColumnController extends Controller class ShowHideColumnController extends Controller
{ {
@ -118,4 +119,14 @@ class ShowHideColumnController extends Controller
return response()->json(['status'=>'failed','message'=>'data show hide column failed updated!','code'=>400], 400); return response()->json(['status'=>'failed','message'=>'data show hide column failed updated!','code'=>400], 400);
} }
} }
public function getColumnByType($type = 'detail')
{
$data = GanttColumnByType::where("calculation_type", $type)->get();
if(!$data)
return response()->json(['status'=>'failed','message'=>'No data found!','code'=> 404], 404);
return response()->json(['status'=>'success','code'=>200,'data'=>$data], 200);
}
} }

10
app/Models/GanttColumnByType.php

@ -0,0 +1,10 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class GanttColumnByType extends Model
{
protected $table = 't_gantt_column_to_type';
}

1
routes/web.php

@ -391,6 +391,7 @@ $router->group(['prefix'=>'api', 'middleware' => 'cors'], function () use ($rout
$router->get('/gantt-show-hide/get-by-gantt/{gantt_id}', 'ShowHideColumnController@getByUserGantt'); $router->get('/gantt-show-hide/get-by-gantt/{gantt_id}', 'ShowHideColumnController@getByUserGantt');
$router->post('/gantt-show-hide/add', 'ShowHideColumnController@add'); $router->post('/gantt-show-hide/add', 'ShowHideColumnController@add');
$router->post('/gantt-show-hide/update/{gantt_id}', 'ShowHideColumnController@update'); $router->post('/gantt-show-hide/update/{gantt_id}', 'ShowHideColumnController@update');
$router->get('/gantt-show-hide/get-column-by-type/{type}', 'ShowHideColumnController@getColumnByType');
$router->post('/shift/add', 'ShiftController@add'); $router->post('/shift/add', 'ShiftController@add');

Loading…
Cancel
Save