当前位置: 首页>>代码示例>>PHP>>正文


PHP Activity::getStreams方法代码示例

本文整理汇总了PHP中Activity::getStreams方法的典型用法代码示例。如果您正苦于以下问题:PHP Activity::getStreams方法的具体用法?PHP Activity::getStreams怎么用?PHP Activity::getStreams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Activity的用法示例。


在下文中一共展示了Activity::getStreams方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

<?php

require "../php/init.php";
$db = DB::getInstance();
$act = Input::get('act');
$outArray = array();
$streams = Activity::getStreams();
foreach ($streams as $stream) {
    $sql = "SELECT stream_id, COUNT(*) TOTAL,\n\t\t\t\t\tsum(case when allocatedTo IS NOT NULL  then 1 else 0 end) as ASSIGNED,\n\t\t\t\t\tsum(case when allocatedTo IS NULL then 1 else 0 end) as UNASSIGNED\n\t\t\tFROM mainData\n\t\t\tOUTER APPLY (SELECT TOP 1 * FROM ACT_AUDIT WHERE XCPID = mainData.XCP_ID order by id desc) AUDIT\n\t\t\tWHERE stream_id = " . $stream->id . "\n\t\t\tGROUP BY stream_id";
    $data = $db->query($sql);
    $result = $data->first();
    if (!($assigned = $result->ASSIGNED)) {
        $assigned = 0;
    }
    if (!($unassigned = $result->UNASSIGNED)) {
        $unassigned = 0;
    }
    if (!($total = $result->TOTAL)) {
        $total = 0;
    }
    $outArray[] = array("Pipeline" => $stream->id, "Status" => "ASSIGNED", "Count" => $assigned);
    $outArray[] = array("Pipeline" => $stream->id, "Status" => "TOTAL", "Count" => $total);
    $outArray[] = array("Pipeline" => $stream->id, "Status" => "UNASSIGNED", "Count" => $unassigned);
}
header("Content-type: application/json");
print json_encode($outArray);
开发者ID:ben-garside,项目名称:XCP,代码行数:26,代码来源:count.php

示例2: foreach

    <label class="sr-only" for="select_feed">Select feed </label>
    <select id="select_feed" name="feed" class="form-control">
      <option value="0">All feeds</option>
      <?php 
foreach (Activity::getFeeds() as $feed) {
    echo '<option value="' . $feed->feed_id . '">' . $feed->feed_name . '</option>';
}
?>
    </select>
  </div>
  <div class="form-group">
    <label class="sr-only" for="select_Pipeline">Select Pipeline</label>
    <select id="select_Pipeline" name="Pipeline" class="form-control">
      <option value="0">All pipelines</option>
      <?php 
foreach (Activity::getStreams() as $stream) {
    echo '<option value="' . $stream->id . '">' . $stream->name . '</option>';
}
?>
    </select>
  </div>
  <input type="hidden" value="" id="select_act" name="act"/>
  <?php 
if ($user->inRole(1)) {
    ?>
        <div class="form-group">
          <label class="sr-only" for="select_Pipeline">Select Pipeline</label>
          <select id="uid" name="uid" class="form-control">
            <option value="<?php 
    echo $user->data()->id;
    ?>
开发者ID:ben-garside,项目名称:XCP,代码行数:31,代码来源:activity.php


注:本文中的Activity::getStreams方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。