system/Model.php

	protected function setTimes($data){
        $date = $this->setDate();
        $return_data = array();

        if ($this->useTimestamps && ! empty($this->createdField) && ! array_key_exists($this->createdField, $data))
        {
            $return_data[$this->createdField] = $date;
        }

        if ($this->useTimestamps && ! empty($this->updatedField) && ! array_key_exists($this->updatedField, $data))
        {
            $return_data[$this->updatedField] = $date;
        }

        return $return_data;
    }

 

insertBatch 수정

	public function insertBatch(array $set = null, bool $escape = null, int $batchSize = 100, bool $testing = false)
	{
		if (is_array($set) && $this->skipValidation === false)
		{
			foreach ($set as $key => $row)
			{
                $set[$key] = array_merge($set[$key], $this->setTimes($row));
				if ($this->cleanRules()->validate($row) === false)
				{
					return false;
				}
			}
		}

		return $this->builder()->testMode($testing)->insertBatch($set, $escape, $batchSize);
	}

 

+ 최근 게시물