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


PHP where函数代码示例

本文整理汇总了PHP中where函数的典型用法代码示例。如果您正苦于以下问题:PHP where函数的具体用法?PHP where怎么用?PHP where使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: get_selected_record2

 public function get_selected_record2($customer_id, $method)
 {
     $this->_db->where('customer_id', $customer_id);
     $this->_db_ > where('payment_method', ".{$method}.");
     $data = $this->_db->get(TBL_SUBSCRIPTION);
     return $data;
 }
开发者ID:nikunj1806,项目名称:product-manager,代码行数:7,代码来源:subsription.class.php

示例2: index

 public function index()
 {
     $offer = where('slug = %s', 'nieuwbouw')->get_row('offer/purpose');
     echo view('head', array('title' => $offer && $offer->seo_title ? $offer->seo_title : 'Projecten', 'description' => $offer && $offer->seo_content ? $offer->seo_content : ''));
     echo view('projects', array());
     echo view('foot', array());
 }
开发者ID:kidaa30,项目名称:Swevers,代码行数:7,代码来源:projects.php

示例3: service

 public function service($slug)
 {
     $service = where('slug = %s', $slug)->require_row('services/service');
     echo view('head', array('title' => $service && $service->seo_title ? $service->seo_title : '', 'description' => $service && $service->seo_content ? $service->seo_content : ''));
     echo view('service', array('service' => $service));
     echo view('foot', array());
 }
开发者ID:kidaa30,项目名称:Swevers,代码行数:7,代码来源:services.php

示例4: beforeAction

 public function beforeAction($action)
 {
     $this->scanModules('payment');
     $arrModules = Modules::model()->findAllByAttributes(array('category' => 'payment'), array('order' => 'module'));
     $this->_allowAdvancedPayments = CPropertyValue::ensureBoolean(Yii::app()->params['ALLOW_ADVANCED_PAY_METHODS']);
     $menuSidebar = array();
     foreach ($arrModules as $module) {
         $currentModule = Yii::app()->getComponent($module->module);
         if (is_null($currentModule)) {
             continue;
         }
         if ($currentModule->cloudCompatible === false && _xls_get_conf('LIGHTSPEED_CLOUD') > 0) {
             continue;
         }
         if ($currentModule->isDisplayable() === false) {
             continue;
         }
         $menuSidebar[] = array('label' => $currentModule->AdminName, 'url' => array('payments/module', 'id' => $module->module), 'advancedPayment' => $currentModule->advancedMode);
     }
     $advancedPaymentMethods = where($menuSidebar, array('advancedPayment' => true));
     $simplePaymentMethods = where($menuSidebar, array('advancedPayment' => false));
     $this->menuItems = array_merge(array(array('label' => 'Simple Integration Modules', 'linkOptions' => array('class' => 'nav-header'))), $simplePaymentMethods, array(array('label' => 'Advanced Integration Modules', 'linkOptions' => array('class' => 'nav-header'), 'visible' => count($advancedPaymentMethods) > 0)), $advancedPaymentMethods, $this->getPaymentSetupLinks());
     $objModules = Modules::model()->findAllByAttributes(array('category' => 'payment', 'active' => 1));
     if (count($objModules) === 0 && $action->id == "index") {
         $this->noneActive = 1;
         Yii::app()->user->setFlash('error', Yii::t('admin', 'WARNING: You have no payment modules activated. No one can checkout.'));
     }
     return parent::beforeAction($action);
 }
开发者ID:uiDeveloper116,项目名称:webstore,代码行数:29,代码来源:PaymentsController.php

示例5: flat_load

/**
 * Load entity
 *
 * @param array $entity
 * @param array $crit
 * @param array $opts
 *
 * @return array
 */
function flat_load(array $entity, array $crit = [], array $opts = []) : array
{
    $stmt = db()->prepare(select($entity['attr']) . from($entity['tab']) . where($crit, $entity['attr'], $opts) . order($opts['order'] ?? [], $entity['attr']) . limit($opts['limit'] ?? 0, $opts['offset'] ?? 0));
    $stmt->execute();
    if (!empty($opts['one'])) {
        return $stmt->fetch() ?: [];
    }
    return $stmt->fetchAll();
}
开发者ID:akilli,项目名称:qnd,代码行数:18,代码来源:flat.php

示例6: searchProviders

 function searchProviders(Request $request)
 {
     $search = $request->input('search');
     $users = User::where('role_id', 2) > where(function ($query) use($search) {
         $query->Where('name', 'like', '%' . $search . '%')->orWhere('last_name', 'like', '%' . $search . '%')->orWhere('email', $search)->orWhere('second_name', 'like', '%' . $search . '%')->orWhere('second_last_name', 'like', '%' . $search . '%')->orWhere('identification', 'like', '%' . $search . '%');
     })->paginate(50);
     $roleName = $this->roleName;
     $routeSearch = 'searchProvider';
     return view('back.users', compact('users', 'roleName', 'routeSearch', 'search'));
 }
开发者ID:juan2ramos,项目名称:agroseller,代码行数:10,代码来源:ProviderController.php

示例7: index

 public function index()
 {
     $home = get_row('home');
     $sale = where('sold = 0 && purpose = 1')->limit(5)->order_by('create_date DESC')->get('skarabee/property');
     $rent = where('sold = 0 && purpose = 2')->limit(5)->order_by('create_date DESC')->get('skarabee/property');
     $projects = where('sold = 0 && type = 3')->limit(5)->order_by('create_date DESC')->get('skarabee/property');
     echo view('head', array('class' => 'home', 'css' => 'home', 'title' => $home->seo_title ? $home->seo_title : $home->title, 'description' => $home->seo_content ? $home->seo_content : $home->content));
     echo view('home', array('home' => $home, 'sale' => $sale, 'rent' => $rent, 'projects' => $projects));
     echo view('foot', array('js' => 'home'));
 }
开发者ID:kidaa30,项目名称:Swevers,代码行数:10,代码来源:home.php

示例8: tiempo_vida

 function tiempo_vida($nombre)
 {
     $this->db->select('tiempo_vida');
     $this->db - where('nombre', $nombre);
     $tiempo = $this->db->get('producto');
     if ($tiempo->num_rows() > 0) {
         return $tiempo->result();
     } else {
         return false;
     }
 }
开发者ID:editoblez,项目名称:labChemical,代码行数:11,代码来源:productos_model.php

示例9: leftframe

 public function leftframe()
 {
     //左边的默认首页
     $table = D('apptree');
     $pid = $_GET['apptreeid'];
     $leftdate = $table->findAll("type='0' and pid ='{$pid}'");
     foreach ($leftdate as $k => $v) {
         $leftdate[$k]['subapp'] = where(' pid =' . $v[id])->field('*')->order('seqNO ASC')->findall();
     }
     $this->assign('left', $leftdate);
     //dump($leftdate);
     $this->display();
 }
开发者ID:lee99,项目名称:tpmaker,代码行数:13,代码来源:IndexAction.class.php

示例10: excluirFuncionario

 public function excluirFuncionario($id_funcionario)
 {
     $result = false;
     if (!isset($_SESSION)) {
         session_start();
     }
     if (!isset($_SESSION['restaurante'])) {
         return $result;
     }
     if (!empty($id_funcionario)) {
         $this->_db > where("id_restaurante", $_SESSION['restaurante']);
         $this->_db > where("id_funcionario", $id_funcionario);
         return $this->_db->delete("functionario");
     }
     return $result;
 }
开发者ID:AvnerGeraldo,项目名称:TCC-SIRP,代码行数:16,代码来源:Funcionario_model.php

示例11: get_site_id

 private static function get_site_id()
 {
     $site = current_site();
     if ($site->piwik_id) {
         return $site->piwik_id;
     }
     $request = 'http://' . self::$api_urls[$_SERVER['SERVER_ADDR']] . '/?module=API&method=SitesManager.getSitesIdFromSiteUrl&url=http://' . rawurlencode($_SERVER['HTTP_HOST']) . '/&format=XML&token_auth=' . self::$auth_token;
     $result = simplexml_load_string(curl($request));
     if (isset($result->row->idsite)) {
         $site_id = $result->row->idsite;
     } else {
         $site_id = self::create_site();
     }
     where('id = %d', $site->id)->update('site', array('piwik_id' => $site_id));
     return $site_id;
 }
开发者ID:kidaa30,项目名称:Swevers,代码行数:16,代码来源:piwik.php

示例12: bind

 /**
  * Bind params, alias where()
  * in query use :param after binding.
  * @param  array $data array('param'=>'value')
  * @return none       
  */
 public function bind($data)
 {
     foreach ($data as $key => $value) {
         where($key, $value);
     }
 }
开发者ID:TheHanif,项目名称:POS-Faizan,代码行数:12,代码来源:class.database.php

示例13: function_delete

 public function function_delete($field, $object, $data, $id)
 {
     $fieldname = strval($field['name']);
     $field_filename = strval($field['name']) . '_filename';
     if (is_object($data)) {
         if ($data->{$fieldname}) {
             $data->{$fieldname}->clear_thumbnails();
         }
         @unlink(FILESPATH . $data->{$field_filename});
         where('id = %d', $data->id)->update($object['stack'], array($fieldname . '_filename' => '', $fieldname . '_orig_filename' => '', $fieldname . '_upload_date' => ''));
         redirect($_SERVER['HTTP_REFERER']);
     } else {
         error(404);
     }
 }
开发者ID:kidaa30,项目名称:Swevers,代码行数:15,代码来源:image.php

示例14: where_check

/** Create SQL condition from query string
* @param string
* @param array
* @return string
*/
function where_check($val, $fields = array())
{
    parse_str($val, $check);
    remove_slashes(array(&$check));
    return where($check, $fields);
}
开发者ID:K0n24d,项目名称:adminer,代码行数:11,代码来源:functions.inc.php

示例15: array

        if ($f['size']) {
            $toinsert = array();
            $extension = substr($f['name'], strrpos($f['name'], '.') + 1);
            do {
                $name = md5(rand(0, 99999) . rand(0, 99999));
            } while (file_exists(FILESPATH . $name . "." . $extension));
            move_uploaded_file($f['tmp_name'], FILESPATH . $name . "." . $extension);
            $toinsert['orig_filename'] = $f['name'];
            $toinsert['filename'] = $name . '.' . $extension;
            $toinsert['upload_date'] = time();
            $toinsert["site_id"] = intval($site->id);
            insert('site>downloads', $toinsert);
        }
    }
}
$site = where('id = %d', $site->id)->get_row('site');
?>
<!doctype html>
<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]>    <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]>    <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	
	<title><?php 
echo l(array('nl' => 'Downloads', 'en' => 'Downloads', 'fr' => 'Downloads'));
?>
</title>
	
开发者ID:kidaa30,项目名称:Swevers,代码行数:30,代码来源:downloadspopup.php


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