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,它是向上或向下,而不是我獲得整個對象。我應該改變什麼? –