php/oracle: 解析oracle表中的NCLOB,CLOB字段里面的内容
假如你的字段名是:passenger_info 字段类型是:NCLOB/CLOB,在读表的时候,需要将 passenger_info 字段转换为字符型.
$orderinfo = Orders::find()->select('id,create_time,total_price,pay_status,order_status,to_char(ticket_info) as ticket_info,to_char(passenger_info) as passenger_info,to_char(bus) as bus,to_char(special_food) as special_food,mobile')->where([
'id' => $paylog['OID']
])->one();
我的passenger_info 字段是base64编码json格式的,所以我读出来的时候需要在进一步转换格式:
$passenger_info = json_decode(base64_decode($orderinfo['PASSENGER_INFO']), true);