1.確定table 裡面有 pointer row
2.
cloudcode
請這樣寫
var _UserTable = Parse.Object.extend("UserTable");
var _PurchaseTable = Parse.Object.extend("PurchaseHistoryTable");
var innerQueryByDevice = new Parse.Query(_UserTable);
innerQueryByDevice.equalTo("DeviceUDID", request.params.user_Deviceudid);
innerQueryByDevice.include("userid");
var list = [];
var listuserid = [];
innerQueryByDevice.find({
success: function(results) {
if(results.length == 0)
{
response.error('fail check DeviceUDID');
}
else
{
for(i = 0; i < results.length; i++)
{
list.push(results[i]);
//list.push({"Status":results[i].get("userid").get("Status"),"Amount":results[i].get("userid").get("Amount")});
}
response.success(list);
//list[i]= results[i].get("userid").toJSON();
}
},
error: function(error) {
response.error("Error: " + error.code + " " + error.message);
}
});
2.
cloudcode
請這樣寫
var _UserTable = Parse.Object.extend("UserTable");
var _PurchaseTable = Parse.Object.extend("PurchaseHistoryTable");
var innerQueryByDevice = new Parse.Query(_UserTable);
innerQueryByDevice.equalTo("DeviceUDID", request.params.user_Deviceudid);
innerQueryByDevice.include("userid");
var list = [];
var listuserid = [];
innerQueryByDevice.find({
success: function(results) {
if(results.length == 0)
{
response.error('fail check DeviceUDID');
}
else
{
for(i = 0; i < results.length; i++)
{
list.push(results[i]);
//list.push({"Status":results[i].get("userid").get("Status"),"Amount":results[i].get("userid").get("Amount")});
}
response.success(list);
//list[i]= results[i].get("userid").toJSON();
}
},
error: function(error) {
response.error("Error: " + error.code + " " + error.message);
}
});