本文整理汇总了PHP中ST::routeToCaApi方法的典型用法代码示例。如果您正苦于以下问题:PHP ST::routeToCaApi方法的具体用法?PHP ST::routeToCaApi怎么用?PHP ST::routeToCaApi使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ST
的用法示例。
在下文中一共展示了ST::routeToCaApi方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: feedInPeriod
public function feedInPeriod(DateTime $start, DateTime $end)
{
$events = Vks::where('start_date_time', ">=", $start)->where('start_date_time', '<=', $end)->whereIn('status', [VKS_STATUS_APPROVED])->orderBy('start_date_time')->with('connection_codes')->get(['id', 'start_date_time', 'end_date_time', 'title', 'status', 'approved_by', 'owner_id', 'is_simple', 'flag']);
//pull from central server
$getFromCA = Curl::get(ST::routeToCaApi("getVksWasInPeriodForTb/" . App::$instance->tbId . "/" . $start->format("Y-m-d H:i:s") . "/" . $end->format("Y-m-d H:i:s")));
$getFromCA = json_decode($getFromCA);
if ($getFromCA && $getFromCA->status == 200) {
$getFromCA = $getFromCA->data;
} else {
$getFromCA = array();
}
//add to events container
foreach ($getFromCA as $CAVks) {
$CAVks->fromCa = true;
$events[] = $CAVks;
}
//!get event
//event customization
foreach ($events as $event) {
$start = $event->start_date_time instanceof DateTime ? $event->start_date_time : date_create($event->start_date_time);
$end = $event->end_date_time instanceof DateTime ? $event->end_date_time : date_create($event->end_date_time);
$event->start_time = $start->format("H:i");
$event->end_time = $end->format("H:i");
$event->date = $start->format("d.m.Y");
$event->start = $start->format("Y-m-d H:i");
$event->end = $end->format("Y-m-d H:i");
$event->titleCustom = $event->title;
$event->title = null;
//костыль
ST::deployColorScheme($event, App::$instance->user->colors['local_default']);
if (Auth::isAdmin(App::$instance)) {
if ($event->status == VKS_STATUS_PENDING) {
$event->titleCustom = '<span class="label label-warning">согл.</span> ' . $event->titleCustom;
ST::deployColorScheme($event, App::$instance->user->colors['local_pending']);
}
}
if (isset($event->fromCa)) {
$event->titleCustom = '<span class="label label-warning">ЦА</span> ' . $event->titleCustom;
ST::deployColorScheme($event, App::$instance->user->colors['fromca_no_local_linked']);
}
if (!isset($event->fromCa) && $event->is_simple) {
ST::deployColorScheme($event, App::$instance->user->colors['local_simple']);
}
if (Auth::isAdmin(App::$instance)) {
if ($event->is_verified_by_user == USER_VERIFICATION_MAIL_SENDED) {
$event->titleCustom = '<span class="label label-default">?</span> ' . $event->titleCustom;
} else {
if ($event->is_verified_by_user == USER_VERIFICATION_APPROVED) {
$event->titleCustom = '<span class="label label-info">Ок</span> ' . $event->titleCustom;
} else {
if ($event->is_verified_by_user == USER_VERIFICATION_DECLINED) {
$event->titleCustom = '<span class="label label-danger">Отказ</span> ' . $event->titleCustom;
}
}
}
}
if (Auth::isAdmin(App::$instance)) {
if ($event->admin_id == App::$instance->user->id) {
ST::deployColorScheme($event, App::$instance->user->colors['local_im_admin']);
}
}
if (Auth::isLogged(App::$instance) && !Auth::isAdmin(App::$instance)) {
if ($event->owner_id == App::$instance->user->id && $event->status != VKS_STATUS_PENDING) {
$event->backgroundColor = "#E65C00";
ST::deployColorScheme($event, App::$instance->user->colors['local_im_owner']);
}
}
}
//end foreach
//!event customization
return $events;
//output
}
示例2: showNaVks
function showNaVks($id)
{
$versionCtrl = new VksVersion_controller();
$load = new Load_controller();
$sc = new Settings_controller();
try {
$vks = Vks::NotSimple()->full()->findOrFail($id);
} catch (Exception $e) {
$this->error('404', $e->getMessage());
}
$vks = $this->humanize($vks);
$att = new AttendanceNew_controller();
$check = boolval(intval(Settings_controller::getOther("attendance_check_enable")));
foreach ($vks->participants as $parp) {
if ($check) {
$parp->free = $att->isFree($parp->id, $vks->start_date_time, $vks->end_date_time, [$vks->id]);
} else {
$parp->free = true;
}
}
if (!self::isVksCanBeApproved($vks)) {
$this->error('500', 'Открыть экран согласования по этой ВКС невозможно, переведите эту ВКС в статус "на согласовании" и попробуйте еще раз');
}
$vks->isPassebByCapacity = $load->isPassedByCapacity($vks->start_date_time, $vks->end_date_time, $this->countParticipants($vks->id), 0);
$caVks = Null;
if ($vks->link_ca_vks_id) {
if ($vks->link_ca_vks_type == 0) {
$caVks = Curl::get(ST::routeToCaApi('getVksWasById/' . $vks->link_ca_vks_id));
} else {
$caVks = Curl::get(ST::routeToCaApi('getVksNsById/' . $vks->link_ca_vks_id));
}
$caVks = json_decode($caVks);
if ($caVks->status == 200) {
$caVks = $caVks->data;
} else {
$caVks = Null;
}
}
$codes = $sc->getCodeDelivery(true);
$versions = $versionCtrl->getVersionsList($vks->id);
$last_version = null;
if (count($versions)) {
$last_version = $versionCtrl->pullVersion($vks->id, $versionCtrl->findLastVersion($vks->id));
}
if ($vks->stack) {
foreach ($vks->stack->vkses as $stVks) {
$this->humanize($stVks);
$stVks->connection_codes = $stVks->connection_codes()->get();
}
}
if ($vks->other_tb_required) {
$vks->CaInPlaceParticipantCount;
$vks->CaIdParticipants;
}
$codesFiltrated = array();
$ca_pool_codes = App::$instance->callService("vks_ca_negotiator")->askForPool();
$currentVksStart = clone $vks->start_date_time;
$currentVksEnd = clone $vks->end_date_time;
if (count($ca_pool_codes)) {
$ca_transport_vkses = App::$instance->callService("vks_ca_negotiator")->aksTransportVksInPeriod($currentVksStart, $currentVksEnd, $ca_pool_codes);
foreach ($ca_pool_codes as $code) {
$codesFiltrated[$code] = array();
if (count($ca_transport_vkses)) {
foreach ($ca_transport_vkses as $ca_tr_vks) {
if ($code == $ca_tr_vks->v_room_num) {
$codesFiltrated[$code][] = $ca_tr_vks;
}
}
}
}
}
$graph = $load->pullLoadDataForJs($vks->humanized->date);
$this->render('vksSubmissions/approvePage', compact('vks', 'graphUrl', 'caVks', 'versions', 'codes', 'last_version', 'graph', 'codesFiltrated'));
}