Tp5 foreach problem

foreach ($res as $k => $v) {
            $res[$k]["o_pay_types"] = $this->getPayType($res[$k]["o_pay_types"]);
        }

when running this code, an error will be reported

Indirect modification of overloaded element of think\paginator\driver\Bootstrap has no effect

what is the problem, please?

Jun.07,2021

what you use tp5 to find out is a collection object, so you can't directly use the array method to get the value. You can solve this problem by adding-> toArray () after the chain operation of the query.


check out what type of $res you are. If it is an object, use-> toArray () and then cycle


$res [$k] ['ostatic payoffs types`] may be empty or null, please print to see


have you solved the same problem?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e450e3-4c20c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e450e3-4c20c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?