<?php $__currentLoopData = $customs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $custom): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    <tr>
        <th colspan="2">
            <div class="d-flex justify-content-between">
                <div class="search_target_title">【オリジナル】<br /><?php echo e($custom->name); ?></div>
                <span class="search_target">検索</span>
            </div>
        </th>

        <td>
            <?php switch($custom->type):
                case (1): ?>
                <?php
                    if (isset($article)) {
                        $content = $article->customs()->where("code", $custom->code)->get()->pluck("contents")->toArray();
                    }
                ?>
                <?php echo $__env->make('admin.objects.components.checkbox', ['name' => "original[{$custom->code}]", 'checkbox' => $custom->content, "checked" => $content], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                <?php break; ?>
                <?php case (2): ?>
                <?php
                    if (isset($article)) {
                        $content = optional($article->customs()->where("code", $custom->code)->first())->contents;
                    }
                ?>
                <?php echo $__env->make('admin.objects.components.selectbox', ['name' => "original[{$custom->code}]", 'options' => $custom->content, 'title' => '未', "selected" => $content], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                <?php break; ?>
                <?php case (3): ?>
                <?php
                    if (isset($article)) {
                        $content = optional($article->customs()->where("code", $custom->code)->first())->contents;
                    }
                ?>
                <?php
                    if($custom->code==7){
                        $new_content = '';
                        $prices = [];
                        foreach($article->histories() as $p){
                            $prices[] = $p->price;
                        }
                        $prices = array_reverse($prices);
                        foreach($prices as $p){
                            if($new_content==''){
                                $new_content = number_format($p, 0) . '万円';
                            }else{
                                $new_content .= ' -> ' . number_format($p, 0) . '万円';
                            }
                        }
                        $content = $new_content;
                    }
                ?>
                <?php echo $__env->make('admin.objects.components.textarea', ['name' => "original[{$custom->code}]", 'class' => 'w500', 'count' => 100, 'placeholder' => $custom->content, "value" => $content], \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                <?php break; ?>
            <?php endswitch; ?>
        </td>
    </tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
