generated from liutk/owl-admin-base
31 lines
781 B
PHP
31 lines
781 B
PHP
<?php
|
|
|
|
namespace App\Admin\Services\Train;
|
|
|
|
use App\Admin\Filters\TrianQuestionFilter;
|
|
use App\Admin\Services\BaseService;
|
|
use App\Models\Train\Question;
|
|
|
|
class QuestionService extends BaseService
|
|
{
|
|
protected array $withRelationships = [];
|
|
|
|
protected string $modelName = Question::class;
|
|
|
|
protected string $modelFilterName = TrianQuestionFilter::class;
|
|
|
|
public function resloveData($data, $model = null)
|
|
{
|
|
if (isset($data['options']) && $data['options']) {
|
|
$options = [];
|
|
foreach ($data['options'] as $key => $item) {
|
|
$item['is_true'] = data_get($item, 'is_true', false);
|
|
array_push($options, $item);
|
|
}
|
|
$data['options'] = $options;
|
|
}
|
|
|
|
return $data;
|
|
}
|
|
}
|