think-orm
think-orm copied to clipboard
[bug] query原生参数绑定,值始终为string
$ceshi = 11; $ceshi1 = 22; Db::query("update xxx set content = json_replace(
content, '$.day', JSON_ARRAY(:ceshi, :ceshi1)) where name = 'xxx'", [ 'ceshi' => $ceshi, 'ceshi1' => $ceshi1 ]);
为题所在: PDOConnection.php(bindValue方法中)$result = $this->PDOStatement->bindValue($param, $val); 使用了默认PDO::PARAM_STR 没有进行值的检测
比较纳闷的是bindValue方法中有个is_array检测,
Db::query('sql....', [ 'param_1' => [111,111] 'param_2' => [222,222] ]);
再次运行上方的sql,发现参数绑定值为int了...........
这么是何用? 官方给个答复呀