The below code is written inside a function in react Model class(MVC Architecture). Every time the function is called the temp variable value is set to 1 but I want the value of the updated temp variable to be assigned to the 1st line. Please help
var temp = 1;
console.log("temp = "+temp)
let sPlanId = constant['SUBSCRIPTION_TIERS'][event_subscription.plan_id];
console.log("SPlanId = "+sPlanId)
if(sPlanId-temp == 1 && sPlanId == 2)
{
fix_project_post_cnt = 4;
temp = sPlanId;
}
else if(sPlanId-temp == 1 && sPlanId == 3)
{
fix_project_post_cnt = 5;
temp = sPlanId;
}
else if(sPlanId-temp == 2 && sPlanId == 3)
{
fix_project_post_cnt = 9;
temp = sPlanId;
}
else if(sPlanId-temp == 1 && sPlanId == 4)
{
fix_project_post_cnt = 10;
temp = sPlanId;
}
else if(sPlanId-temp == 2 && sPlanId == 4)
{
fix_project_post_cnt = 15;
temp = sPlanId;
}
else if(sPlanId-temp == 3 && sPlanId == 4)
{
fix_project_post_cnt = 19;
temp = sPlanId;
}
Aucun commentaire:
Enregistrer un commentaire