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


PHP Period::getId方法代码示例

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


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

示例1: getVoted1k

 public static function getVoted1k(Period $period)
 {
     $q = Doctrine_Query::create()->select('v.*')->from('Vote v')->where('v.id_period = ?', $period->getId())->andWhere('v.weight > 50')->execute()->getFirst();
     if ($q) {
         return $q->getPrice();
     } else {
         return false;
     }
 }
开发者ID:rollmax,项目名称:read2read,代码行数:9,代码来源:VoteTable.class.php

示例2: getSoldArticlesQuery

 public static function getSoldArticlesQuery(User $user, Period $period, $c_sort = null)
 {
     if (!is_null($c_sort)) {
         $sortby = $c_sort['sortby'];
         $order = $c_sort['order'];
     } else {
         $sortby = 'pub_date';
         $order = 'desc';
     }
     $q = Doctrine_Query::create()->select('c.id, sum(t.amount) as sell_sum, count(cp.id) as sell_count')->from('Content c')->leftJoin('c.Category ct')->leftJoin('c.ContentPurchase cp')->leftJoin('cp.Transaction t with t.id_period = ?', $period->getId())->where('c.id_user = ?', $user->getId())->andWhere('c.state = "public"')->groupBy('c.id')->orderBy("{$sortby} {$order}");
     return $q;
 }
开发者ID:rollmax,项目名称:read2read,代码行数:12,代码来源:ContentTable.class.php

示例3: addPeriod

 /**
  * cree une nouvelle periode
  * @param String $per_name
  * @param int $per_start
  * @param int $per_end
  * @return String $csvResult
  */
 public function addPeriod($per_name, $per_start, $per_end)
 {
     $rtn = new ComplexData();
     $per = new Period(0, $this->Fundation->getId(), $per_name, $per_start, $per_end);
     $rtn->addLine(array($per->getState(), $per->getId()));
     return $rtn->csvArrays();
 }
开发者ID:buckutt,项目名称:Archives,代码行数:14,代码来源:FADMIN.class.php

示例4: getSoldStatsForPeriod

 public function getSoldStatsForPeriod(Period $period)
 {
     $q = Doctrine_Query::create()->select('u.id, sum(t.amount) as sell_sum, count(t.id) as sell_count, count(c.id) as content_count, sum(c.letters_k) as letter_sum')->from('User u')->leftJoin('u.Content c')->leftJoin('c.ContentPurchase cp')->leftJoin('cp.Transaction t with t.id_period = ?', $period->getId())->where('u.id = ?', $this->getId())->groupBy('u.id')->execute();
     return $q->getFirst();
 }
开发者ID:rollmax,项目名称:read2read,代码行数:5,代码来源:User.class.php

示例5: addUserToDroit

 /**
  * Ajoute un droit à un user entre 2 dates.
  * 
  * @param int  $id_user
  * @param int  $date_start
  * @param int  $date_end
  * @param int  $point
  * @param int  $fundation
  * @return int $state
  */
 public function addUserToDroit($id_user, $date_start, $date_end, $point = 0, $fundation = 0)
 {
     $Period = new Period(0, 1, '', $date_start, $date_end);
     $per_id = $Period->getId();
     if ($point == 0 && $fundation == 0) {
         $this->db->query("INSERT INTO tj_usr_rig_jur (usr_id, rig_id, per_id) VALUES ('%u', '%u', '%u')", array($id_user, $this->id, $Period->getId()));
     } elseif ($point == 0) {
         $this->db->query("INSERT INTO tj_usr_rig_jur (usr_id, rig_id, per_id, fun_id) VALUES ('%u', '%u', '%u', '%u')", array($id_user, $this->id, $Period->getId(), $fundation));
     } elseif ($fundation == 0) {
         $this->db->query("INSERT INTO tj_usr_rig_jur (usr_id, rig_id, per_id, poi_id) VALUES ('%u', '%u', '%u', '%u')", array($id_user, $this->id, $Period->getId(), $point));
     } else {
         $this->db->query("INSERT INTO tj_usr_rig_jur (usr_id, rig_id, per_id, fun_id, poi_id) VALUES ('%u', '%u', '%u', '%u', '%u')", array($id_user, $this->id, $Period->getId(), $fundation, $point));
     }
     if ($this->db->affectedRows() == 1) {
         return 1;
     } else {
         return 400;
     }
 }
开发者ID:buckutt,项目名称:Archives,代码行数:29,代码来源:Right.class.php

示例6: addUserToGroup

 /**
  * Ajoute un groupe à un user entre 2 dates.
  * 
  * @param int  $id_user
  * @param int  $date_start
  * @param int  $date_end
  * @return int $state
  */
 public function addUserToGroup($id_user, $date_start, $date_end)
 {
     $Period = new Period(0, 1, '', $date_start, $date_end);
     $per_id = $Period->getId();
     $this->db->query("INSERT INTO tj_usr_grp_jug (usr_id, grp_id, per_id) VALUES ('%u', '%u', '%u')", array($id_user, $this->id, $Period->getId()));
     if ($this->db->affectedRows() == 1) {
         return 1;
     } else {
         return 400;
     }
 }
开发者ID:buckutt,项目名称:Archives,代码行数:19,代码来源:Group.class.php

示例7: countWeights

 public static function countWeights(Period $period)
 {
     // общая сумма продаж
     $tSum = BalanceSystemTable::getInstance()->findOneByIdPeriod($period->getId())->getToPayPUsers();
     $q = UserTable::addPUserQuery()->execute();
     foreach ($q as $user) {
         if (($bu = BalanceUserTable::getByUserIdAndPeriodId($user->getId(), $period->getId())) !== false) {
             $uWeight = $bu->getPayable() * 100 / $tSum;
             $user->setWeight((double) $uWeight);
             $user->save();
         }
     }
 }
开发者ID:rollmax,项目名称:read2read,代码行数:13,代码来源:UserTable.class.php


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