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


PHP oseDB::delete方法代码示例

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


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

示例1: remove

 function remove()
 {
     $ids = JRequest::getVar('ids', array(), 'post');
     foreach ($ids as $id) {
         $updated = oseDB::delete($this->table, array('id' => $id));
         if (!$updated) {
             break;
         }
     }
     $result = array();
     if ($updated) {
         $result['success'] = true;
         $result['title'] = JText::_('SUCCESS');
         $result['content'] = JText::_('Saved');
     } else {
         $result['success'] = false;
         $result['title'] = JText::_('ERROR');
         $result['content'] = JText::_('Fail Saving');
     }
     $result = oseJSON::encode($result);
     oseExit($result);
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:22,代码来源:member.domain.php

示例2: updatePaypalOrderInfo

 function updatePaypalOrderInfo()
 {
     $result = array();
     $id = JRequest::getInt('id');
     $order_number = JRequest::getCmd('order_number');
     $serial_number = JRequest::getCmd('payment_serial_number');
     $payment_price = JRequest::getFloat('payment_price');
     $email = JRequest::getString('email');
     $db = oseDB::instance();
     $query = " SELECT * FROM `#__osemsc_order_fix`" . " WHERE `member_id` = '{$id}'";
     $db->setQuery($query);
     $item = oseDB::loadItem('obj');
     if (empty($item)) {
         $query = " SELECT * FROM `#__osemsc_member`" . " WHERE `id` = '{$id}'";
         $db->setQuery($query);
         $memInfo = oseDB::loadItem('obj');
         // generate order and order item
         // we can copy other order to modify
         $query = " SELECT b.*,a.`params` as `oiParams` FROM `#__osemsc_order_item` AS a" . " INNER JOIN `#__osemsc_order` AS b ON a.`order_id` = b.`order_id`" . " WHERE a.`entry_id` = '{$memInfo->msc_id}' AND b.`order_status`='confirmed'" . " AND b.`payment_mode` = 'a'" . " AND b.`payment_method` = 'paypal'" . " ORDER BY b.`order_id` DESC" . " LIMIT 1";
         $db->setQuery($query);
         $oItem = oseDB::loadItem();
         unset($oItem['order_id']);
         $oItem['order_number'] = empty($order_number) ? $this->generateOrderNumber($item->user_id) : $order_number;
         $oItem['create_date'] = oseHtml::getDateTime();
         //$oItem['payment_serial_number'] = $serial_number;
         $oItem['payment_method'] = 'paypal';
         $oItem['user_id'] = $memInfo->member_id;
         // check the order number
         if (!empty($order_number)) {
             $query = " SELECT * FROM `#__osemsc_order`" . " WHERE `order_number` = " . $db->Quote($order_number) . " AND `user_id` = '{$memInfo->member_id}'";
             $db->setQUery($query);
             $fitem = oseDB::loadItem('obj');
             if (!empty($fitem)) {
                 $noItem = array();
                 $noItem['order_id'] = $fitem->order_id;
                 if (strlen($fitem->order_number) >= 32) {
                     $noItem['order_number'] = $this->generateOrderNumber($item->user_id);
                 } else {
                     $noItem['order_number'] = $fitem->order_number . '_no';
                 }
                 $updated = oseDB::update('#__osemsc_order', 'order_id', $noItem);
             }
             $updated = oseDB::insert('#__osemsc_order', $oItem);
         } else {
             $updated = oseDB::insert('#__osemsc_order', $oItem);
         }
         if (!$updated) {
             $result['success'] = false;
             $result['title'] = JText::_('ERROR');
             $result['content'] = JText::_('ERROR1');
             oseExit(oseJSON::encode($result));
         }
         $oVals = array();
         $oVals['order_id'] = $updated;
         $oVals['entry_id'] = $memInfo->msc_id;
         $oVals['payment_price'] = $oItem['payment_price'];
         $oVals['payment_currency'] = $oItem['payment_currency'];
         $oVals['params'] = $oItem['oiParams'];
         $updated = oseDB::insert('#__osemsc_order_item', $oVals);
         if (!$updated) {
             oseDB::delete('#__osemsc_order', array('order_id' => $updated));
             $result['success'] = false;
             $result['title'] = JText::_('ERROR');
             $result['content'] = JText::_('ERROR2');
             oseExit(oseJSON::encode($result));
         }
         // update member table params
         $mVals = array();
         $mVals['params'] = array();
         $mVals['id'] = $id;
         $mVals['params']['order_id'] = $oVals['order_id'];
         $mVals['params']['order_item_id'] = $updated;
         $mVals['params']['payment_mode'] = 'a';
         $mVals['params'] = oseJson::encode($mVals['params']);
         oseDB::update("#__osemsc_member", 'id', $mVals);
         // update the order paypal status
         $ofVals = array();
         $ofVals['order_id'] = $oVals['order_id'];
         $ofVals['order_item_id'] = $updated;
         $ofVals['member_id'] = $id;
         $ofVals['msc_id'] = $memInfo->msc_id;
         $ofVals['user_id'] = $memInfo->member_id;
         $ofVals['hasParams'] = 1;
         $ofVals['payment_method'] = 'paypal';
         $ofVals['payment_mode'] = 'a';
         $ofVals['status'] = 'updated';
         $ofVals['create_date'] = oseHtml::getDateTime();
         $ofVals['params'] = $oItem['params'];
         $ofVals['email'] = $email;
         oseDB::insert("#__osemsc_order_fix", $ofVals);
     } elseif (empty($item->order_id)) {
         $query = " SELECT * FROM `#__osemsc_member`" . " WHERE `id` = '{$id}'";
         $db->setQuery($query);
         $memInfo = oseDB::loadItem('obj');
         // generate order and order item
         // we can copy other order to modify
         $query = " SELECT b.*,a.`params` as `oiParams` FROM `#__osemsc_order_item` AS a" . " INNER JOIN `#__osemsc_order` AS b ON a.`order_id` = b.`order_id`" . " WHERE a.`entry_id` = '{$memInfo->msc_id}' AND b.`order_status`='confirmed'" . " AND b.`payment_mode` = 'a'" . " AND b.`payment_method` = 'paypal'" . " ORDER BY b.`order_id` DESC" . " LIMIT 1";
         $db->setQuery($query);
         $oItem = oseDB::loadItem();
         unset($oItem['order_id']);
//.........这里部分代码省略.........
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:101,代码来源:paypal.php

示例3: delete

 function delete()
 {
     $vals = $this->getProperties();
     return oseDB::delete($this->_table, array('id' => $this->id));
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:5,代码来源:oseMemMscV5.php

示例4: cancel

	public static function cancel($params)
	{
		$result = array();
		$result['success'] = true;

		if(empty($params['allow_work']))
		{
			$result['success'] = false;
			$result['title'] = 'Error';
			$result['content'] = JText::_("Error");
			return $result;
		}
		unset($params['allow_work']);
		$member_id = $params['member_id'];
		$msc_id = $params['msc_id'];
		$user = JFactory::getUser($member_id);
		
		$db = oseDB::instance();
		
		$query = "SELECT * FROM `#__osemsc_member`"
				." WHERE `msc_id` = '{$msc_id}' AND `member_id` = '{$member_id}'"
				;
		$db->setQuery($query);
		$memInfo = oseDB::loadItem('obj');
		$memParams = oseJson::decode($memInfo->params,true);

		$order_id = $memParams['order_id'];
		$order_item_id = $memParams['order_item_id'];
		$query = " SELECT * FROM `#__osemsc_order`"
		." WHERE `order_id` = '{$order_id}'"
		;
		$db->setQuery($query);
		$order = oseDB::loadItem('obj');
		$oParams = oseJson::decode($order->params);
		//$msc_option = oseObject::getValue($oParams,'msc_option');
		
		$query = " SELECT * FROM `#__osemsc_order_item`"
				." WHERE `order_id` = '{$order_id}'"
				;
		$db->setQuery($query);
		$order_item = oseDB::loadItem('obj');
		$iParams = oseJson::decode($order_item->params);
		$msc_option = $iParams->msc_option;
		
		if(oseGetValue($oParams,'isLicensee',0))
		{
			$result['success'] = true;
			$result['title'] = JText::_('Done');
			$result['content'] = JText::_("Done");
				
			return $result;
		}

		$query = " SELECT * FROM `#__osemsc_ext`"
				." WHERE `id` = '{$msc_id}' AND `type` = 'oselic'"
				;
		$db->setQuery($query);
		$data = oseDB::loadItem('obj');
		$data = oseJson::decode($data->params);
		$data = oseObject::getValue($data,$msc_option,array());
		
		if( oseObject::getValue($data,'enable_license') )
		{
			oseRegistry :: register('user2', 'user2');
			oseRegistry :: register('lic', 'lic');
			oseRegistry :: register('email', 'email');
			oseRegistry :: register('locale', 'locale');
			$user = oseCall('user2')->instance( $member_id,'lic');
			
			$query = " SELECT * FROM `#__oselic_type_license_key`"
			." WHERE `license_id` = '{$oParams->license_id}' AND `licensee_id` > 0"
			;
			$db->setQuery($query);
			$licenseKeys = oseDB::loadList('obj');
			
			foreach($licenseKeys as $licenseKey)
			{
				if(!empty($licenseKey->licensee_id))
				{
					switch($licenseKey->app)
					{
						case('msc'):
							//version
							oseAppConfig::load( 'mscv6' );
							break;
						default:
							oseAppConfig::load($licenseKey->app);
						break;
					}
					$user = oseCall('user2')->instance($licenseKey->licensee_id,$licenseKey->app);
					$user->cancel($licenseKey->entry_id,$licenseKey->app);
				}
				else
				{
					continue;
				}
			}
				
			// delete license info
			oseDB::delete('#__oselic_type_license_key',array('license_id'=>$oParams->license_id));
//.........这里部分代码省略.........
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:101,代码来源:join.oselic.php

示例5: delete

 function delete()
 {
     $updated = oseDB::delete($this->_table, array('plan_id' => $this->get('plan_id')));
     return $updated;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:5,代码来源:manual.php

示例6: delete

 function delete()
 {
     $where = array();
     $where['id'] = $this->get('id');
     return oseDB::delete($this->table, $where);
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:6,代码来源:oseInit.php


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