Using laravel's chunkById paragraph query method, query 2K at a time, and then batch into the database , since this table has not been changed, it can be directly queried and imported
The problem encountered is that the data attribute after the query is an array, which must be manually assembled before it can be directly stored in the database. There are a lot of fields. Just imagine if it can be Get this attribute data directly and then throw it into the array and store it directly in the database
The queried data is like this (recommended: "php video tutorial")
is a private attribute
Directly (array)$value is like this
$arrTemp['x00* x00attributes'] should be fine. I tried it and it works.
public function getProtectedValue($obj, $name) { $array = (array)$obj; $prefix = chr(0).'*'.chr(0); return $array[$prefix.$name]; }The ASCII code corresponding to x00 in the screenshot is 0. Use chr to convert the ASCII code of 0 into a string. That is, the ASCII code corresponding to chr(0) is x00, and then splicing * is OKThe adjusted code is
$arrTemp = $this->getProtectedValue($value, 'attributes');