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

namespace Application\Service\DB\Collect;
use Interop\Container\ContainerInterface;
use Laminas\Stdlib\ArrayUtils;
use Application\Common\Com;
class Patientrawlock extends \Application\Service\DB\AbstractDb
{
    public function __construct($dbAdapter, ContainerInterface $container)
    {
        $this->tableName = 'yikeen_collect_patientrawlock';
        parent::__construct($dbAdapter, $container);
    }

    /**
     * Notes: 获取指定条件下的锁定数据
     * User: lltyy
     * DateTime: 2023/5/18 8:56
     *
     * @param $where
     * @return array[]
     */
    public function fetchLockByRaw($where,$columns){
        $datas = [];
        //获取指定条件下的锁定数据
        $cond = [
            'where'=>$where,
            'columns'=>$columns,
            'order'=>['raw_id']
        ];
        $lockdatas = $this->fetchAll($cond);
        if(!empty($lockdatas)){
            foreach($lockdatas as &$lockdata) {
                $raw_id = $lockdata['raw_id'];
                $datas[$raw_id] = $lockdata;
            }
        }
        unset($cond);
        unset($lockdatas);
        return $datas;
    }
}