You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
861 B
44 lines
861 B
<?php
|
|
|
|
namespace App\Http\Controllers\Api;
|
|
|
|
use App\Logics\ProjectControl;
|
|
use Illuminate\Http\Request;
|
|
|
|
class ProjectJsonController extends ApiController
|
|
{
|
|
public function getProjectTypes(Request $request)
|
|
{
|
|
return ProjectControl::getJsonForProjectTypes();
|
|
}
|
|
|
|
public function getProjectFuncTypesByTypeId(Request $request)
|
|
{
|
|
$pid = 0;
|
|
$where = [];
|
|
$data = [];
|
|
if (isset($request->q))
|
|
{
|
|
$pid = $request->q;
|
|
}
|
|
if ($pid < 0) return $data;
|
|
$where = [$pid];
|
|
$data = ProjectControl::getProjectFuncTypesByOneLevel($where);
|
|
return $data;
|
|
}
|
|
|
|
public function getProjectModelsByFunctypeId(Request $request)
|
|
{
|
|
$pid = 0;
|
|
$where = [];
|
|
$data = [];
|
|
if (isset($request->q))
|
|
{
|
|
$pid = $request->q;
|
|
}
|
|
if ($pid < 0) return $data;
|
|
$where = [$pid];
|
|
$data = ProjectControl::getProjectModelsByOneLevel($where);
|
|
return $data;
|
|
}
|
|
} |