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


PHP oseDB::implodeWhere方法代码示例

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


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

示例1: getList

 public function getList($type, $backend = false)
 {
     $db = oseDB::instance();
     $where = array();
     if ('member' == substr($type, 0, 6)) {
         $where[] = "a.`type` LIKE 'member_%'";
     } else {
         $where[] = "a.`type` = " . $db->Quote($type);
     }
     $where[] = "b.`enabled` = 1 ";
     $where = oseDB::implodeWhere($where);
     $query = " SELECT a.*,b.enabled,b.custom,b.backend AS custom_backend, b.backend_enabled AS custom_backend_enabled,b.frontend AS custom_frontend, b.frontend_enabled AS custom_frontend_enabled" . " FROM `#__osemsc_addon` AS a" . " INNER JOIN `#__osemsc_addon_applied` AS b ON b.addon_id =a.id" . $where;
     $db->setQuery($query);
     $types = oseDB::loadList('array', 'name');
     foreach ($types as $key => $type) {
         $valid = $this->authorize($type['type'], $type['name'], $backend);
         if (!$valid) {
             unset($types[$key]);
             continue;
         }
         if ($type['custom']) {
             $type['backend'] = $type['custom_backend'];
             $type['frontend'] = $type['custom_frontend'];
             $type['backend_enabled'] = $type['custom_backend_enabled'];
             $type['frontend_enabled'] = $type['custom_frontend_enabled'];
         }
         if ($type['action'] == 1) {
             $type['action'] = "{$type['type']}.{$type['name']}";
         }
         $types[$key] = $type;
     }
     //$types = array_values($types);
     return $types;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:34,代码来源:oseMscAddon.php

示例2: getMemlist

	public function getMemlist() {
		$search = JRequest::getString('search', null);
		$start = JRequest::getInt('start', 0);
		$limit = JRequest::getInt('limit', 20);
		$msc_id = JRequest::getInt('msc');
		$status = JRequest::getVar('status');
		$db = oseDB::instance();
		$where = array();
		$where[] = ' m.msc_id = ' . $msc_id;
		if (isset($status) && $status != 'all') {
			$where[] = ' m.status = ' . $status;
		}
		if (!empty($search)) {
			$searchQuery = $db->Quote('%' . $search . '%');
			$where[] = "m.username LIKE {$searchQuery} OR m.name LIKE {$searchQuery} OR m.email LIKE {$searchQuery}";
		}
		$where = oseDB::implodeWhere($where);
		$query = " SELECT COUNT(*) " . " FROM `#__osemsc_member_view` AS m " . " INNER JOIN `#__osemsc_billinginfo` AS b ON m.member_id = b.user_id" . $where;
		$db->setQuery($query);
		$total = $db->loadResult();
		$query = " SELECT * " . " FROM `#__osemsc_member_view` AS m " . " INNER JOIN `#__osemsc_billinginfo` AS b ON m.member_id = b.user_id" . $where;
		$db->setQuery($query, $start, $limit);
		$items = oseDB::loadList();
		$result = array();
		$result['total'] = $total;
		$result['results'] = $items;
		return $result;
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:28,代码来源:memlist.php

示例3: getItem

 function getItem()
 {
     $result = array();
     $post = JRequest::get('post');
     $post = oseMscAddon::getPost('licseat_', $post);
     if (!isset($post['contact_send'])) {
         $post['contact_send'] = 0;
     }
     if (!isset($post['internal_contact_send'])) {
         $post['internal_contact_send'] = 0;
     }
     $db = oseDB::instance();
     $msc_id = JRequest::getInt('msc_id', 0);
     $member_id = JRequest::getInt('member_id', 0);
     $mscLicInfo = oseRegistry::call('msc')->getExtInfo($msc_id, 'lic', 'obj');
     $mscLicInfoParams = oseObject::getParams($mscLicInfo);
     $where = array();
     $where[] = "license_user_id = '{$member_id}'";
     if (empty($mscLicInfoParams->id)) {
         $where[] = "license_id = '{$mscLicInfoParams->id}'";
     }
     $where = oseDB::implodeWhere();
     $query = " SELECT * FROM `#__oselic_license_seat`" . $where . " ORDER BY id DESC";
     $db->setQuery($query);
     $item = oseDB::loadItem('obj');
     $result['success'] = empty($item) ? false : true;
     $result['total'] = empty($item) ? 0 : 1;
     $result['result'] = empty($item) ? array() : $item;
     //$result = oseJson::encode($result);
     return $result;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:31,代码来源:member.licseat.php

示例4: sendToGroup

 function sendToGroup($email, $group, $force2Send = false)
 {
     $db = oseDB::instance();
     $version = oseHTML::getJoomlaVersion();
     if (is_array($group)) {
         $group = implode(',', $group);
     }
     $where = array();
     if (!$force2Send) {
         $where[] = "`sendEmail` =1";
     }
     if ($version == '1.5') {
         $where[] = "`gid` IN ( {$group} )";
         $where = oseDB::implodeWhere($where);
         $query = " SELECT * FROM `#__users` AS u " . $where;
     } else {
         $where[] = "g.group_id IN ( {$group} )";
         $where = oseDB::implodeWhere($where);
         $query = " SELECT u.* FROM `#__users` AS u " . " INNER JOIN `#__user_usergroup_map` AS g ON g.user_id = u.id" . $where;
     }
     $db->setQuery($query);
     $objs = oseDB::loadList('obj');
     foreach ($objs as $obj) {
         self::sendEmail($email, $obj->email);
     }
     return true;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:27,代码来源:email.php

示例5: getMap

 function getMap()
 {
     // get License
     $db = oseDB::instance();
     // active
     $where = array();
     $where[] = "`member_id` = '{$this->user_id}'";
     $where[] = "`status` = 1";
     $where = oseDB::implodeWhere($where);
     $query = " SELECT * FROM `{$this->_table}`" . $where . " ORDER BY `id` ASC";
     $db->setQuery($query);
     $items = oseDB::loadList('obj', 'msc_id');
     $this->set('active_membership', $items);
     //expired
     $where = array();
     $where[] = "`member_id` = '{$this->user_id}'";
     $where[] = "`status` = 0";
     $where = oseDB::implodeWhere($where);
     $query = " SELECT * FROM `{$this->_table}`" . $where . " ORDER BY `id` ASC";
     $db->setQuery($query);
     $items = oseDB::loadList('obj', 'msc_id');
     $this->set('expired_membership', $items);
     //suspend
     $where = array();
     $where[] = "`member_id` = '{$this->user_id}'";
     $where[] = "`status` = 3";
     $where = oseDB::implodeWhere($where);
     $query = " SELECT * FROM `{$this->_table}`" . $where . " ORDER BY `id` ASC";
     $db->setQuery($query);
     $items = oseDB::loadList('obj', 'msc_id');
     $this->set('suspend_membership', $items);
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:32,代码来源:oseMemMscV5.php

示例6: save

 public static function save($params = array())
 {
     $db = oseDB::instance();
     $post = JRequest::get('post');
     $id = JRequest::getCmd('id', null);
     $msc_id = JRequest::getInt('msc_id', 0);
     if (empty($id)) {
         $id = uniqid();
     }
     $extItem = oseRegistry::call('msc')->getExtInfoItem($msc_id, 'acymailing2', 'obj');
     $extItem->params = empty($extItem->params) ? '{}' : $extItem->params;
     $items = oseJson::decode($extItem->params, true);
     $where = array();
     $msc_id = isset($msc_id) ? $msc_id : null;
     if (empty($msc_id)) {
         return false;
         // No membership exists in the addon
     } else {
         unset($post['msc_id']);
         $where[] = 'id = ' . $db->Quote($msc_id);
     }
     $where[] = 'type = ' . $db->Quote('acymailing2');
     $params = array();
     $prefix = 'acymailing2_';
     foreach ($post as $key => $value) {
         if (strstr($key, $prefix)) {
             $newKey = preg_replace("/{$prefix}/", '', $key, 1);
             $params[$newKey] = $value;
         }
     }
     ksort($params);
     $params['id'] = $id;
     $items[$id] = $params;
     $newParams = $db->Quote(oseJson::encode($items));
     $where = oseDB::implodeWhere($where);
     $query = " SELECT * FROM `#__osemsc_ext` " . $where;
     $db->setQuery($query);
     $obj = oseDB::loadItem('obj');
     if (empty($obj)) {
         $query = " INSERT INTO `#__osemsc_ext` " . " (id,type,params)" . " VALUES " . " ({$msc_id}," . $db->Quote('acymailing2') . ",{$newParams}) ";
         $db->setQuery($query);
         //oseExit($db->_sql);
     } else {
         $query = " UPDATE `#__osemsc_ext` " . " SET " . " params = {$newParams} " . " WHERE id = {$obj->id}" . " AND type = " . $db->Quote('acymailing2');
         $db->setQuery($query);
     }
     if (oseDB::query()) {
         $result['success'] = true;
         $result['title'] = JText::_('Finished');
         $result['content'] = JText::_('Save Successfully!');
     } else {
         $result['success'] = false;
         $result['title'] = JText::_('Error');
         $result['content'] = JText::_('Error in Saving License Parameters');
     }
     return $result;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:57,代码来源:panel.acymailing2.php

示例7: getInfo

 function getInfo($id, $type = 'array')
 {
     $db = oseDB::instance();
     $where = array();
     $where[] = "`id` = " . $db->Quote($id);
     $where = oseDB::implodeWhere($where);
     $query = " SELECT * FROM `#__osemsc_acl`" . " WHERE `id` = '{$id}'";
     $db->setQuery($query);
     $item = oseDB::loadItem($type);
     return $item;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:11,代码来源:msc.php

示例8: uniqueUserName

 function uniqueUserName($username, $user_id = 0)
 {
     $db = oseDB::instance();
     $where = array();
     $username = $db->Quote(strtolower($username));
     $where[] = "LOWER(username) = {$username}";
     if (!empty($user_id)) {
         $where[] = "id != {$user_id}";
     }
     $where = oseDB::implodeWhere($where);
     $query = " SELECT COUNT(*) FROM `#__users`" . $where;
     $db->setQuery($query);
     $isValid = $db->loadResult() > 0 ? false : true;
     return $isValid;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:15,代码来源:oseMemUser.php

示例9: getTotal

 private function getTotal()
 {
     $db = oseDB::instance();
     //$my = JFactory::getUser();
     $member_id = JRequest::getInt('member_id', 0);
     $where = array();
     $where[] = "o.user_id = '{$member_id}'";
     $where[] = "o.entry_type IN ('msc','msc_list')";
     $where = oseDB::implodeWhere($where);
     $query = " SELECT COUNT(*) " . " FROM `#__osemsc_order` AS o " . " INNER JOIN `#__users` AS u ON u.id = o.user_id" . $where;
     $db->setQuery($query);
     //oseExit($db->_sql);
     $result = $db->loadResult();
     return $result;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:15,代码来源:member.order.php

示例10: getHistory

 public static function getHistory($msc_id, $member_id, $action = null)
 {
     $db = oseDB::instance();
     $where = array();
     if (!empty($action)) {
         $where[] = " `action` = '{$action}'";
     }
     $where[] = " `msc_id` = '{$msc_id}'";
     $where[] = " `member_id` = '{$member_id}'";
     $where = oseDB::implodeWhere($where);
     $query = " SELECT * FROM `#__osemsc_member_history` " . $where . " ORDER BY date DESC";
     $db->setQuery($query);
     $objs = oseDB::loadList('obj');
     return $objs;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:15,代码来源:oseMemHistroy.php

示例11: array

 function &getArtList()
 {
     $db = oseDB::instance();
     $cat_id = JRequest::getInt('cat_id', 0);
     $search = JRequest::getString('search', null);
     $search = JString::strtolower($search);
     $msc_id = JRequest::getInt('msc_id', 0);
     $start = JRequest::getInt('start', 0);
     $limit = JRequest::getInt('limit', 20);
     $where = array();
     if ($cat_id) {
         $where[] = 'c.category_id = ' . $cat_id;
     }
     $where = oseDB::implodeWhere($where);
     $query = " SELECT COUNT(*)" . " FROM `#__zoo_category_item` AS c " . $where;
     $db->setQuery($query);
     $total = $db->loadResult();
     $query = " SELECT i.id,i.name" . " FROM `#__zoo_item` AS i " . " RIGHT JOIN `#__zoo_category_item` AS c" . " ON i.`id` = c.`item_id`" . $where . " ORDER BY i.id";
     $db->setQuery($query, $start, $limit);
     $rows = oseDB::loadList('obj');
     foreach ($rows as $item) {
         $item->treename = $item->name;
         $obj = oseRegistry::call('content')->getInstance('msc')->getItem('zoo', 'article', $item->id, 'msc', $msc_id, null, 'obj');
         $controlled = empty($obj) ? 0 : $obj->status;
         if ($controlled == '1') {
             $item->controlled = JText::_('SHOW_TO_MEMBERS');
         } elseif ($controlled == '-1') {
             $item->controlled = JText::_('HIDE_TO_MEMBERS');
         } else {
             $item->controlled = JText::_('SHOW_TO_ALL');
         }
         $item->leaf = true;
         $item->iconCls = 'task';
         $item->checked = false;
         //$item->controlled = $controlled;
     }
     $result = array();
     $result['total'] = $total;
     $result['results'] = $rows;
     return $result;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:41,代码来源:content.zoocat.php

示例12: getOrders

 public function getOrders()
 {
     $member_id = JRequest::getInt('member_id', 0);
     $start = JRequest::getInt('start', 0);
     $limit = JRequest::getInt('limit', 0);
     $type = JRequest::getInt('type', 0);
     $db = oseDB::instance();
     $where = array();
     $filterStatus = JRequest::getString('filter_status', null);
     $where[] = "o.entry_type IN ('msc','msc_list')";
     $where[] = "o.payment_from != 'system_admin'";
     $where[] = "o.`user_id` = '{$member_id}'";
     $where[] = "o.`payment_method` IN ('beanstream','authorize','paypal_cc')";
     $where[] = "o.`payment_mode` = 'a' ";
     $where[] = "o.`order_status`='confirmed'";
     $where = oseDB::implodeWhere($where);
     $query = " SELECT COUNT(*) " . " FROM `#__osemsc_order` AS o " . " INNER JOIN `#__users` AS u ON u.id = o.user_id" . $where;
     $db->setQuery($query);
     //oseExit($db->getQuery());
     $total = $db->loadResult();
     $query = " SELECT CONCAT('Order:',o.order_id) AS title, u.username,u.name, o.* " . " FROM `#__osemsc_order` AS o " . " INNER JOIN `#__users` AS u ON u.id = o.user_id" . $where . " ORDER BY o.create_date DESC";
     $db->setQuery($query, $start, $limit);
     //oseExit($db->getQuery());
     $items = oseDB::loadList();
     $return = array();
     $i = 0;
     foreach ($items as $item) {
         $item['mscTitle'] = self::getMSCTitle($item['order_id']);
         $item['name'] = $item['user_id'] . ' - ' . $item['name'];
         $item['title'] = $item['title'] . ' - ' . $item['mscTitle'];
         $return[$i] = $item;
         $i++;
     }
     $result = array();
     $result['total'] = $total;
     //$this->getTotal();
     $result['results'] = $return;
     $result = oseJson::encode($result);
     oseExit($result);
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:40,代码来源:member.creditcardupdate.php

示例13: getConfig

 static function getConfig($config_type = null, $type = 'array')
 {
     $db = oseDB::instance();
     $where = array();
     if (!empty($config_type)) {
         if (is_array($config_type)) {
             $values = array();
             foreach ($config_type as $configType) {
                 $values[] = $db->Quote($configType);
             }
             $where[] = 'type IN (' . implode(',', $values) . ')';
         } else {
             $where[] = 'type=' . $db->Quote($config_type);
         }
     }
     $where = oseDB::implodeWhere($where);
     $query = " SELECT * FROM `#__osemsc_configuration` " . $where;
     $db->setQuery($query);
     $objs = oseDB::loadList('obj');
     if ($type == 'array') {
         $config = array();
         foreach ($objs as $obj) {
             $config[$obj->key] = $obj->value;
             //oseObject::setValue($config,$obj->key,$obj->value);
         }
     } else {
         $config = new stdClass();
         foreach ($objs as $obj) {
             $config->{$obj->key} = $obj->value;
             //oseObject::setValue($config,$obj->key,$obj->value);
         }
     }
     /*foreach($objs as $obj)
     		{
     			$config = oseObject::setValue($config,$obj->key,$obj->value);
     		}*/
     $config = oseObject::setValue($config, 'id', 1);
     return $config;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:39,代码来源:oseMscConfig.php

示例14: getList

 public function getList()
 {
     $db = oseDB::instance();
     $search = JRequest::getString('search', null);
     $search = JString::strtolower($search);
     $start = JRequest::getInt('start', 0);
     $limit = JRequest::getInt('limit', 20);
     $dir = JRequest::getCmd('dir', 'ASC');
     $sortField = JRequest::getCmd('sort', 'domain');
     $msc_id = JRequest::getInt('msc_id');
     $user_id = JRequest::getInt('user_id');
     $where = array();
     $where[] = "`mscID` = '{$msc_id}'";
     $where[] = "`userID` = '{$user_id}'";
     if (!empty($search)) {
         $searchQuery = $db->Quote('%' . $search . '%');
         $where[] = "`domain` LIKE {$searchQuery}";
     }
     $where = oseDB::implodeWhere($where);
     $query = " SELECT COUNT(*) " . " FROM `#__osetickets_domains` " . $where;
     $db->setQuery($query);
     $total = $db->loadResult();
     $query = " SELECT *" . " FROM `#__osetickets_domains` " . $where . " ORDER BY {$sortField} {$dir}";
     if ($start >= 0 && $limit >= 0) {
         $db->setQuery($query, $start, $limit);
     } else {
         $db->setQuery($query);
     }
     $items = oseDB::loadList('obj');
     $list = array();
     foreach ($items as $key => $item) {
         $list[$key] = $item;
     }
     $resul = array();
     $result['total'] = $total;
     $result['results'] = $list;
     oseExit(oseJson::encode($result));
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:38,代码来源:member.domain.php

示例15: getTotal

 function getTotal($email_type)
 {
     $db = oseDB::instance();
     $where = array();
     $items = array();
     if (!empty($email_type)) {
         $where[] = ' type = ' . $db->Quote($email_type);
     }
     $where = oseDB::implodeWhere($where);
     $query = " SELECT COUNT(*) FROM `#__osemsc_email` " . $where;
     $db->setQuery($query);
     $result = $db->loadResult();
     return $result;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:14,代码来源:oseMemEmail.php


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