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

namespace Application\Service\DB\Item;

use Interop\Container\ContainerInterface;

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

    /**
     * Notes:拼接数组
     * @param
     * @return
     * @author haojinhua
     * @date 2024-03-14 16:18
     */
    public function fetchTypeName($where){
        $res = [];
        $where = !empty($where) ? $where : 'is_del =0';
        $where_arr = [
            'where'=>$where,
            'columns'=>['logtype_name','logtype_action'],
            'order'=>'id'
        ];
        $datas = $this->fetchAll($where_arr);
        if(!empty($datas)){
            foreach($datas as $data){
                $res[$data['logtype_action']] = $data['logtype_name'];
            }
        }
        unset($data);
        //echo "<pre>";print_r($res);die;
        return $res;
    }
}