0
我写了这个查询得到字符串type(value)
,这是向上或向下,而是它返回一个对象。laravel查询retun对象而不是字符串
$o_response = $this->statuses()
->where('status_id', $o_health_status->id)
->orderBy('created_at', 'desc')
->select('values')
->first();
这是结果:
{"values":"up","pivot":{"notification_id":1,"status_id":1,"values":"up","created_at":"2016-11-04 13:18:29","updated_at":"2016-11-04 13:18:29"}}
它返回一个对象,而不是字符串。为什么?
我期待得到一个字符串vsalue,它是向上或向下,而不是我获得整个对象。我应该改变什么? –