本文整理汇总了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);
示例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;
?>