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


PHP Notification::all方法代码示例

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


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

示例1: index

 /**
  * @before _secure
  */
 public function index()
 {
     $this->seo(array("title" => "Dashboard", "description" => "Stats for your Data"));
     $view = $this->getActionView();
     $commissions = [];
     $start = RM::get("start", date("Y-m-d", strtotime('now')));
     $end = RM::get("end", date("Y-m-d", strtotime('now')));
     $today = date('Y-m-d');
     $yesterday = date('Y-m-d', strtotime("-1 day"));
     $perf = Shared\Services\User::livePerf($this->user, $today, $today);
     $yestPerf = Shared\Services\User::livePerf($this->user, $yesterday, $yesterday);
     $notifications = Notification::all(["org_id = ?" => $this->org->id, "meta = ?" => ['$in' => ['all', $this->user->_id]]], [], "created", "desc", 5, 1);
     $total = Performance::total(['start' => date("Y-m-d", strtotime('-365 day')), 'end' => date("Y-m-d", strtotime('-2 day'))], $this->user);
     $view->set("start", date("Y-m-d", strtotime('-7 day')))->set("end", date("Y-m-d", strtotime('now')))->set("notifications", $notifications)->set("total", $total)->set("yestPerf", $yestPerf)->set("performance", $perf);
 }
开发者ID:vNative,项目名称:vnative,代码行数:18,代码来源:advertiser.php

示例2: array

<?php

//les variables comme posts et tests ne sont pas transmise,
$res->notificationsNumber = Notification::all(array('conditions' => array('to_user_id' => $res->user->id, 'status' => 0)))->count;
$res->useTemplate();
开发者ID:Osin,项目名称:Intranet,代码行数:5,代码来源:block.menu.php

示例3: notification

 /**
  * @before _secure
  */
 public function notification()
 {
     $this->seo(array("title" => "Notification"));
     $view = $this->getActionView();
     $fields = ['_id', 'name'];
     $arr = User::all(['org_id' => $this->org->_id, 'type' => 'publisher'], $fields);
     $publishers = User::objectArr($arr, $fields);
     $arr = User::all(['org_id' => $this->org->_id, 'type' => 'advertiser'], $fields);
     $advertisers = User::objectArr($arr, $fields);
     $view->set('publishers', $publishers)->set('advertisers', $advertisers);
     switch (RM::post("action")) {
         case 'save':
             $meta = RM::post("meta", "all");
             $message = RM::post("message");
             $success = "Saved Successfully";
             if ($meta !== "all" && (!in_array($meta, array_keys($publishers)) && !in_array($meta, array_keys($advertisers)))) {
                 $view->set('message', "Invalid Request!!");
                 break;
             } else {
                 if ($meta !== "all") {
                     // send mail to the user
                     $usr = User::first(['_id' => $meta], ['name', 'email']);
                     \Shared\Services\Smtp::sendMail($this->org, ['template' => 'notification', 'user' => $usr, 'notification' => $message, 'to' => [$usr->email], 'subject' => "Notification from " . $this->org->name]);
                     $success .= " And Mail sent";
                 }
             }
             $n = new Notification(["org_id" => $this->org->id, "message" => $message, "target" => RM::post("target"), "meta" => $meta]);
             $n->save();
             $view->set("message", $success);
             break;
     }
     if (RM::type() === 'DELETE') {
         $id = RM::get("id");
         $n = Notification::first(["org_id = ?" => $this->org->id, "id = ?" => $id]);
         if ($n) {
             $n->delete();
             $view->set("message", "Deleted Successfully");
         } else {
             $view->set("message", "Notification does not exist");
         }
     }
     $notifications = Notification::all(["org_id = ?" => $this->org->id], [], "created", "desc");
     $view->set("notifications", $notifications);
 }
开发者ID:vNative,项目名称:vnative,代码行数:47,代码来源:admin.php

示例4: array

<?php

$res->notifications = Notification::all(array('conditions' => array('to_user_id' => $res->user->id, 'status' => 0), 'limit' => 5))->asArray();
$res->useTemplate();
开发者ID:Osin,项目名称:Intranet,代码行数:4,代码来源:block.notifications.php


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