mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-11 14:11:06 +03:30
add require scanner checkbox
This commit is contained in:
@@ -86,6 +86,9 @@ class TestTypeController extends Controller
|
||||
'test_type_id' => $TestType->id,
|
||||
'parent_id' => $ParentID
|
||||
];
|
||||
if ($Input['type'] == 'Text') {
|
||||
$InputData['require_scanner'] = $Input['require_scanner'];
|
||||
}
|
||||
$InputObj = Input::create($InputData);
|
||||
//---------------------------------------------Input
|
||||
//---------------------------------------------Option
|
||||
@@ -112,6 +115,7 @@ class TestTypeController extends Controller
|
||||
|
||||
public function store(StoreTestTypeRequest $request)
|
||||
{
|
||||
// dd($request->all());
|
||||
try {
|
||||
$return_value = \DB::transaction(function () use ($request) {
|
||||
|
||||
@@ -160,6 +164,7 @@ class TestTypeController extends Controller
|
||||
'name' => $Input->name,
|
||||
'type' => $Input->type,
|
||||
'size' => $Input->size ,
|
||||
'require_scanner' => $Input->require_scanner ,
|
||||
'parent_id' => $Input->parent_id,
|
||||
'options' => [],
|
||||
'children' => []
|
||||
@@ -242,6 +247,9 @@ class TestTypeController extends Controller
|
||||
'test_type_id' => $TestType->id,
|
||||
'parent_id' => $ParentID
|
||||
];
|
||||
if ($Input['type'] == 'Text') {
|
||||
$InputData['require_scanner'] = $Input['require_scanner'];
|
||||
}
|
||||
Input::where('id',$Input['id'])->update($InputData);
|
||||
$InputObj = Input::findOrFail($Input['id']);
|
||||
//---------------------------------------------Input
|
||||
@@ -395,12 +403,12 @@ class TestTypeController extends Controller
|
||||
}
|
||||
if (isset($testType) && $testType) {
|
||||
|
||||
$inputs = Input::select('id', 'name', 'type', 'size', 'parent_id')->with(
|
||||
$inputs = Input::select('id', 'name', 'type', 'size', 'parent_id', 'require_scanner')->with(
|
||||
['options' => function ($query) {
|
||||
$query->select('id', 'title','input_id');
|
||||
},
|
||||
'children' => function ($query) {
|
||||
$query->select('id', 'name', 'type', 'size', 'parent_id', 'test_type_id');
|
||||
$query->select('id', 'name', 'type', 'size', 'parent_id', 'test_type_id', 'require_scanner');
|
||||
},
|
||||
'children.options' => function ($query) {
|
||||
$query->select('id', 'title', 'input_id');
|
||||
|
||||
Reference in New Issue
Block a user