在每个特定数据中添加动态数据值

时间:2019-05-24 02:24:51

标签: php math

您好,新的PHP程序员在这里,我在创建一个cms评估,并且我希望该评估的值自动添加并除以该评估的一部分百分比ex。(35%),请亲切指导我该如何进行逻辑运算。

$url="https://dev.azure.com/MYproject"
$personalAccessToken="fdsafasdfdsafasd"
$project = "TEST"

GetWorkItems

function GetWorkItems
{
    # using env vars passed from VSTS build
    $collectionuri = $Env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI
    $token = $Env:SYSTEM_ACCESSTOKEN # need to configure build to allow passing OAuth tokens

    $basicAuth = "{0}:{1}" -f "", $personalAccessToken
    $basicAuth = [System.Text.Encoding]::UTF8.GetBytes($basicAuth)
    $basicAuth = [System.Convert]::ToBase64String($basicAuth)
    $headers = @{Authorization=("Basic {0}"-f $basicAuth)}

    $WorkItemType = 'Recently updated'

    $url = $collectionuri + 'DefaultCollection/_apis/wit/wiql?api-version=5.0'

    $WIQL_query = "Select [System.Id], [System.Title], [System.State] From WorkItems Where [System.IterationPath] Under 'Sprint number two' AND [State] = 'Active' order by [Microsoft.VSTS.Common.Priority] asc, [System.CreatedDate] desc"
    $body = @{ query = $WIQL_query }
    $bodyJson=@($body) | ConvertTo-Json

    $response = Invoke-RestMethod -Uri $url -headers $headers -Method Post -ContentType "application/json" -Body $bodyJson

    $workitems = $response.workItems

    Write-Host "Found" $workitems.Count "work items of type:" $WorkItemType
}



我想要获得的输出是该特定评估的所有点及其百分比%的加法,有关清楚的解释,请参见下面的示例输入和输出。

Add all points with the eva 1 id compute the percentage base on given percent data
currently out put 
code :
<?php echo $roweva["evaluation"];?>(<?php echo $roweva["percent"];?>%)
<?php echo $rowpts["points"]; ?> hidden-><?php echo $roweva["maxpts"]; ?>
view :
eva 1 (50%)
5
5
5
eva 2 (50%)
10
10

0 个答案:

没有答案