以下是我现在所拥有的:
$users = DB::Table('Home_LogStudents')
->select('LogSt_data','LogSt_date','LogSt_studid')
->where('LogSt_action','=',225)
->where('LogSt_sectionID','=',$id)
->whereIn('LogSt_date',function($query){
$query->select('LogSt_date')
->from('Home_LogStudents')
->where('LogSt_data','!=',0)
->where('LogSt_action','=',225)
->where('LogSt_sectionID','=',$id)
->whereIn('LogSt_studid',function($query){
$query->select('home_id')
->from('Hw_StudentClasses')
->join('Home_Students','Home_Students.home_studid','=','Hw_StudentClasses.Stclass_studid')
->where('Stclass_classid','=',$class_id);
}
)
->groupBy('LogSt_studid');
})
->orderBy('LogSt_data','DESC')
->take(10)
->get();
我知道JSON.stringify但是如何将其转换回字符串中的对象?
答案 0 :(得分:2)
我知道JSON.stringify,但我怎样才能将它转换回来 来自字符串的对象?
使用JSON.parse
console.log(JSON.parse('{"data":{"message":"{\"ErrorLine\":113,\"ErrorMessage\":\"Authentication Failed\",\"ErrorNumber\":50004,\"ErrorProcedure\":\"start_test\"}"},"status":400,"statusText":"Bad Request"}'));