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


PHP generate_where_statement函数代码示例

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


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

示例1: _get_where_clause

 function _get_where_clause()
 {
     $where = '';
     $whereClauses = array();
     if (isset($_REQUEST['query'])) {
         foreach (array_keys($this->_popupMeta['whereClauses']) as $key) {
             append_where_clause($whereClauses, $key, $this->_popupMeta['whereClauses'][$key]);
             if ($key == 'name' && !empty($_REQUEST['name'])) {
                 $whereClauses[count($whereClauses) - 1] = "(" . $whereClauses[count($whereClauses) - 1] . " or teams.name_2 like '" . $GLOBALS['db']->quote($_REQUEST['name']) . "%')";
             }
         }
         $where = generate_where_statement($whereClauses);
     }
     if (!empty($this->_popupMeta['whereStatement'])) {
         if (!empty($where)) {
             $where .= ' AND ';
         }
         $where .= $this->_popupMeta['whereStatement'];
     }
     if (!empty($_REQUEST['custom_method'])) {
         if (!empty($_REQUEST['user_id'])) {
             $where .= !empty($where) ? ' and' : '';
             // deleted=0 added to fix CRYS-470.
             $where .= " teams.id in (select team_id from team_memberships where user_id = '" . $_REQUEST['user_id'] . "' and deleted=0)";
         } else {
             $where .= !empty($where) ? ' and teams.private = 0' : ' teams.private = 0';
         }
     }
     return $where;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:30,代码来源:Popup_picker.php

示例2: _get_where_clause

 function _get_where_clause()
 {
     $where = '';
     if (isset($_REQUEST['query'])) {
         $where_clauses = array();
         append_where_clause($where_clauses, "name", "acl_roles.name");
         $where = generate_where_statement($where_clauses);
     }
     return $where;
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:10,代码来源:Popup_picker.php

示例3: _get_where_clause

 function _get_where_clause()
 {
     $where = '';
     if (isset($_REQUEST['query'])) {
         $where_clauses = array();
         append_where_clause($where_clauses, "name", "emails.name");
         append_where_clause($where_clauses, "contact_name", "contacts.last_name");
         $where = generate_where_statement($where_clauses);
     }
     return $where;
 }
开发者ID:omusico,项目名称:sugar_work,代码行数:11,代码来源:Popup_picker.php

示例4: _get_where_clause

 function _get_where_clause()
 {
     $where = '';
     if (isset($_REQUEST['query'])) {
         $where_clauses = array();
         append_where_clause($where_clauses, "first_name", "users.first_name");
         append_where_clause($where_clauses, "last_name", "users.last_name");
         append_where_clause($where_clauses, "user_name", "users.user_name");
         $where = generate_where_statement($where_clauses);
     }
     return $where;
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:12,代码来源:Popup_picker.php

示例5: _get_where_clause

	function _get_where_clause()
	{
		$where = '';
		if(isset($_REQUEST['query']))
		{
			$where_clauses = array();
			append_where_clause($where_clauses, "first_name", "users.first_name");
			append_where_clause($where_clauses, "last_name", "users.last_name");
			append_where_clause($where_clauses, "user_name", "users.user_name");
		
			$where = generate_where_statement($where_clauses);
		}
		$GLOBALS['log']->debug("module.employees.popup_picker,  where: " . $where);
		
		return $where;
	}
开发者ID:jeffcao,项目名称:fzglsys_v5,代码行数:16,代码来源:Popup_picker.php

示例6: _get_where_clause

 function _get_where_clause()
 {
     $where = '';
     $whereClauses = array();
     if (isset($_REQUEST['query'])) {
         foreach (array_keys($this->_popupMeta['whereClauses']) as $key) {
             append_where_clause($whereClauses, $key, $this->_popupMeta['whereClauses'][$key]);
         }
         $where = generate_where_statement($whereClauses);
     }
     if (!empty($this->_popupMeta['whereStatement'])) {
         if (!empty($where)) {
             $where .= ' AND ';
         }
         $where .= $this->_popupMeta['whereStatement'];
     }
     return $where;
 }
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:18,代码来源:Popup_picker.php

示例7: Material

global $currentModule;
$seed_object = new Material();
/* require_once('modules/Prices/Price.php');
$price = new Price();*/
$where = "";
//$where2 = "";
if (isset($_REQUEST['query'])) {
    $search_fields = array("num", "name", "category", "measure");
    $where_clauses = array();
    $where_clauses2 = array();
    append_where_clause($where_clauses, "num", "materials.num");
    append_where_clause($where_clauses, "name", "materials.name");
    append_where_clause($where_clauses, "category", "materials.category");
    append_where_clause($where_clauses, "measure", "materials.measure");
    //append_where_clause($where_clauses2, "price", "prices.price");
    $where = generate_where_statement($where_clauses);
    //$where2 = generate_where_statement($where_clauses2);
    $GLOBALS['log']->info($where);
}
$image_path = 'themes/' . $theme . '/images/';
////////////////////////////////////////////////////////
// Start the output
////////////////////////////////////////////////////////
if (isset($_REQUEST['html'])) {
    if ($_REQUEST['html'] == 'supplies' || $_REQUEST['html'] == 'purchaseorders') {
        $form = new XTemplate('modules/Materials/Popup_cust.html');
        $GLOBALS['log']->debug("using file modules/Materials/Popup_cust.html");
        $form->assign("MOD", $mod_strings);
        $form->assign("APP", $app_strings);
        // the form key is required
        if (!isset($_REQUEST['form'])) {
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:31,代码来源:Popup.php

示例8: testGenerateWhereStatement

 public function testGenerateWhereStatement()
 {
     $where = array("dog = '1'", "cat = '3'");
     $this->assertEquals("dog = '1' and cat = '3'", generate_where_statement($where));
 }
开发者ID:jgera,项目名称:sugarcrm_dev,代码行数:5,代码来源:MiscUtilsTest.php

示例9: _get_where_clause

 function _get_where_clause()
 {
     $where = '';
     $whereClauses = array();
     if (isset($_REQUEST['query'])) {
         //Edit Peter Peshev
         if (isset($_REQUEST['filter0']) && isset($_REQUEST['filtervalue0'])) {
             $keys = array_keys($_GET);
             for ($i = 0; $i < count($keys); $i++) {
                 if (substr_count($keys[$i], "filter") > 0) {
                     $index = substr($keys[$i], -1, 1);
                     if (isset($_GET["filter" . $index]) && isset($_GET["filtervalue" . $index])) {
                         if (empty($_GET["filtervalue" . $index])) {
                             return $where = '';
                         }
                         $filter = $_GET["filter" . $index];
                         $filtervalue = $_GET["filtervalue" . $index];
                         if (empty($where)) {
                             if ($filtervalue == 'NULL') {
                                 $where = $where . " {$filter} IS NULL ";
                             } else {
                                 $where = $where . " {$filter}='{$filtervalue}' ";
                             }
                         } else {
                             if ($filtervalue == 'NULL') {
                                 $where = $where . " AND {$filter} IS NULL ";
                             } else {
                                 $where = $where . " AND {$filter}='{$filtervalue}' ";
                             }
                         }
                     }
                 }
             }
         } else {
             foreach (array_keys($this->_popupMeta['whereClauses']) as $key) {
                 append_where_clause($whereClauses, $key, $this->_popupMeta['whereClauses'][$key]);
             }
             $where = generate_where_statement($whereClauses);
         }
     }
     return $where;
 }
开发者ID:BackupTheBerlios,项目名称:livealphaprint,代码行数:42,代码来源:Popup_picker.php


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