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


PHP Am_Query::query方法代码示例

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


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

示例1: autocompleteAction

 public function autocompleteAction()
 {
     $term = '%' . $this->getParam('term') . '%';
     $exclude = $this->getInt('exclude');
     if (!$term) {
         return null;
     }
     $q = new Am_Query($this->getDi()->userTable);
     $q->addWhere('((t.login LIKE ?) OR (t.email LIKE ?) OR (t.name_f LIKE ?) OR (t.name_l LIKE ?))', $term, $term, $term, $term);
     if ($exclude) {
         $q->addWhere('user_id<>?', $exclude);
     }
     $q->addWhere('is_affiliate>?', 0);
     $qq = $q->query(0, 10);
     $ret = array();
     while ($r = $this->getDi()->db->fetchRow($qq)) {
         $ret[] = array('label' => sprintf('%s / "%s" <%s>', $r['login'], $r['name_f'] . ' ' . $r['name_l'], $r['email']), 'value' => $r['login']);
     }
     if ($q->getFoundRows() > 10) {
         $ret[] = array('label' => sprintf("... %d more rows found ...", $q->getFoundRows() - 10), 'value' => null);
     }
     $this->ajaxResponse($ret);
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:23,代码来源:AdminController.php

示例2: autocompleteAction

 public function autocompleteAction()
 {
     $term = '%' . $this->getParam('term') . '%';
     if (!$term) {
         return null;
     }
     $q = new Am_Query($this->getDi()->userTable);
     $q->addWhere('(t.login LIKE ?) OR (t.email LIKE ?) OR (t.name_f LIKE ?) OR (t.name_l LIKE ?)', $term, $term, $term, $term);
     $this->getDi()->hook->call(Am_Event::ADMIN_USERS_AUTOCOMPLETE, array('query' => $q, 'term' => $term));
     $qq = $q->query(0, 10);
     $ret = array();
     while ($r = $this->getDi()->db->fetchRow($qq)) {
         $ret[] = array('label' => sprintf('%s / "%s" <%s>', $r['login'], $r['name_f'] . ' ' . $r['name_l'], $r['email']), 'value' => $r['login']);
     }
     if ($q->getFoundRows() > 10) {
         $ret[] = array('label' => sprintf("... %d more rows found ...", $q->getFoundRows() - 10), 'value' => null);
     }
     $this->ajaxResponse($ret);
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:19,代码来源:AdminUsersController.php

示例3: getProductWelcomeEmails

 /**
  * Return allowed product emails as objects
  * @return array of ResourceAbstract
  * @see self::selectAllowedResources
  */
 function getProductWelcomeEmails($product_ids)
 {
     $ret = array();
     $groups = $this->getDi()->db->selectCol("SELECT product_category_id from ?_product_product_category where product_id IN (?a)", $product_ids);
     $groups[] = -1;
     $q = new Am_Query($this, 'r');
     $q->clearFields();
     $q->addField('DISTINCT r.resource_id', 'resource_id');
     $q->leftJoin('?_email_template', 'et', '(r.resource_id = et.email_template_id)');
     $q->addWhere("resource_type = ?", ResourceAccess::EMAILTEMPLATE);
     $q->addWhere("(r.fn = 'product_id' AND r.id IN (?a) ) OR (r.fn = 'product_category_id' AND r.id IN (?a) )", $product_ids, $groups);
     $q->addWhere('et.name=?', EmailTemplate::PRODUCTWELCOME);
     $q->groupBy('resource_id');
     $res = $this->_db->fetchRows($q->query());
     $ret = array();
     foreach ($res as $r) {
         $ret[] = $this->getDi()->emailTemplateTable->load($r['resource_id']);
     }
     return $ret;
 }
开发者ID:grlf,项目名称:eyedock,代码行数:25,代码来源:ResourceAccess.php

示例4: autocompleteAction

 public function autocompleteAction()
 {
     $term = '%' . $this->getParam('term') . '%';
     if (!$term) {
         return null;
     }
     $q = new Am_Query($this->getDi()->couponTable);
     $q->addWhere('code LIKE ?', $term);
     $qq = $q->query(0, 10);
     $ret = array();
     $options = $this->getDi()->couponBatchTable->getOptions();
     while ($r = $this->getDi()->db->fetchRow($qq)) {
         $ret[] = array('label' => $r['code'] . ' - ' . $options[$r['batch_id']], 'value' => $r['code']);
     }
     if ($q->getFoundRows() > 10) {
         $ret[] = array('label' => sprintf("... %d more rows found ...", $q->getFoundRows() - 10), 'value' => null);
     }
     $this->ajaxResponse($ret);
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:19,代码来源:AdminCouponsController.php

示例5: export

 public function export(AffPayout $payout, Am_Query $details, Zend_Controller_Response_Http $response)
 {
     $q = $details->query();
     while ($d = $payout->getDi()->db->fetchRow($q)) {
         $d = $payout->getDi()->affPayoutDetailTable->createRecord($d);
         /* @var $d AffPayoutDetail */
         $aff = $d->getAff();
         $rows[] = array($aff->data()->get('aff_bitcoin_wallet'), moneyRound($d->amount), Am_Currency::getDefault(), $aff->user_id, "Affiliate commission to " . amDate($payout->thresehold_date));
     }
     $this->sendCsv("bitcoint-commission-" . $payout->payout_id . ".txt", $rows, $response);
 }
开发者ID:grlf,项目名称:eyedock,代码行数:11,代码来源:PayoutMethod.php


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