-1
我有一个需要击中的用户的目标,并且该用户通过了我希望它显示不同颜色的目标。所以现在我有目标所需的全部目标* time_spent/day_length。如何跟踪目标点数?
例如,如果目标是10,用户得到11分,我希望它显示不同的颜色,因为他通过了目标。我如何获得结果以显示通过的目标?
我在想这样的事情
$color_performace = function($value, $goal) {
if($value < $goal)
return 'notenough';
elseif($value >$goal)
return 'awesome';
else
return 'enough';
};
和功能
$total_goals_class = $color_performance($total_goals,round($goals_needed*$goal_multiplier));
更新后的代码... – Ris