I just want to try calculate percentage

Posted 2 months ago by tanveerkhanwd
//THE FOLLOWING CODE IS NOT WORKING 
$startWeight = $gw->start_weight;
$endWeight = $gw->weight;
$act = GameActivityWet::where('game_id','=',$gw->game->id)->where('type','=',2)->where('status','=',1)->groupBy('creator_id')->select('*','weight($startWeight/$endWeight*100) as percentage')->get();

Please sign in or create an account to participate in this conversation.