数据库查询返回问题
$data=DB::table('contracts')
->join('details', 'contracts.user_id', '=', 'details.user_id')
->where('contracts.id', '=', 11)
->get();
我是这样的查询语句
打印出来孙这个样子的
Array ( [0] => stdClass Object ( [id] => 11 [cname] => 老胡的试用合同 [type] => 1 [Content] => test [ckey] => ZDNhOGFhOWYwYjM4NjExNjM2MmM3ZDJiZDUyOWMxODE= [cnumber] => SY1439448585525829 [state] => 2 [starttime] => 2015-08-13 [endtime] => 2015-10-13 [user_id] => 10 [htid] => 11 [dekey] => 4IV69jJbbuse0GuKqeu96Tk9xC3Ho2l5vTkLlvs314394485855258292295 [created_at] => 2015-08-13 06:49:30 [updated_at] => 2015-08-13 06:49:30 [detype] => 2 [dname] => 老胡国际贸易有限公司 [dtype] => 3 [caddress] => www.papapa.im [image] => 27661439448570.png [dnumber] => 123456789101111 [dename] => 老胡 [ctel] => 13161726298 ) )
同时toArray不被支持,我应该怎样处理获得arrary格式?
1 个回复
风兮清扬
赞同来自:
设置这句话。或者用ArrayObject包裹对象.