<?php
/**
 *
 * @author：llbjj
 * @DateTime：2022/5/6 10:57
 * @Description：
 *
 */

namespace Application\Service\DB\Dictionary;

use Interop\Container\ContainerInterface;

class Detectkeyword extends \Application\Service\DB\AbstractDb
{
    public function __construct($dbAdapter, ContainerInterface $container)
    {
        $this->tableName = 'yikeen_dictionary_detectkeyword';
        parent::__construct($dbAdapter, $container);
    }


    public function getFiledRelation(array $where,$filed){
        $res = [];
        $where = empty($where) ? [
            'is_del' => 0,
        ] : $where;
        $cond = [
            'where' => $where,
            'columns' => $filed,
            'order' => ['id'],
        ];
        $datas = $this->fetchAll($cond);
        if(!empty($datas)){
            foreach ($datas as $data){
                $name_id = $data['name_id'];
                $res[$name_id][] = $data['name'];
            }
        }

        return  $res;
    }



}