本文整理汇总了PHP中ps_DB::loadResult方法的典型用法代码示例。如果您正苦于以下问题:PHP ps_DB::loadResult方法的具体用法?PHP ps_DB::loadResult怎么用?PHP ps_DB::loadResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ps_DB
的用法示例。
在下文中一共展示了ps_DB::loadResult方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
/**
* Добавление трекинг номера к заказу
*
* @param type $order_id
* @param type $privider
* @return type
*/
function add($order_id, $provider, $tracknumber, $date = '', $city = '', $name = '')
{
require_once CLASSPATH . 'ps_orderlog.php';
$orderlog = new ps_orderlog();
$tracking = $this->getTracking($order_id);
$dblog = new ps_DB();
$query = "SELECT provider FROM " . $this->_table;
$query .= ' WHERE order_id = ' . $order_id;
$dblog->query($query);
$prev_provider = $dblog->loadResult($query);
if (!$tracking) {
$query = "INSERT INTO " . $this->_table;
$WHERE = '';
} else {
$query = "UPDATE " . $this->_table;
$WHERE = ' WHERE order_id = ' . $order_id;
}
$query .= " SET order_id='" . $order_id . "', provider='" . $provider . "', tracknumber='" . $tracknumber . "', date='" . $date . "', city='" . $city . "', name='" . $name . "'";
$query .= $WHERE;
$ret = $this->db->setQuery($query);
$ret = $this->db->Query($query);
if ($this->db->getErrorNum()) {
echo $this->db->stderr();
return false;
}
if ($provider != $prev_provider) {
$orderlog->saveLog($order_id, 'Изменение трекинга', '', $prev_provider, $provider);
}
return $ret;
}
示例2:
/**
* Lists Shipping Methods of all published Shipping Modules
*
* @param string $ship_to_info_id
* @param string $shipping_method_id
*/
function list_shipping_methods($ship_to_info_id = null, $shipping_method_id = null)
{
global $PSHOP_SHIPPING_MODULES, $vmLogger, $auth, $weight_total;
if (empty($ship_to_info_id)) {
// Get the Bill to user_info_id
$database = new ps_DB();
$database->setQuery("SELECT user_info_id FROM #__{vm}_user_info WHERE user_id=" . $auth['user_id'] . " AND address_type='BT'");
$vars["ship_to_info_id"] = $_REQUEST['ship_to_info_id'] = $database->loadResult();
} else {
$vars['ship_to_info_id'] = $ship_to_info_id;
}
$vars['shipping_rate_id'] = $shipping_method_id;
$vars["weight"] = $weight_total;
$vars['zone_qty'] = vmRequest::getInt('zone_qty', 0);
$i = 0;
$theme = new $GLOBALS['VM_THEMECLASS']();
$theme->set_vars(array('vars' => $vars, 'PSHOP_SHIPPING_MODULES' => $PSHOP_SHIPPING_MODULES));
echo $theme->fetch('checkout/list_shipping_methods.tpl.php');
}
示例3: intval
function update_date_delivery()
{
// Обновляем дату доставки
$order_id = intval($_REQUEST['order_id']);
if (!$order_id) {
return array('mess' => 'не указан номер заказа', 'result' => false);
}
$date_full = $date = isset($_REQUEST['date_delivery_full']) ? $_REQUEST['date_delivery_full'] : false;
$date_full = "Доставка: " . $date_full . "\r\n";
if ($date) {
$date = explode(" ", $date);
list($d, $m, $y) = explode(".", $date[0]);
if (!$d || !$m || !$y) {
return array('mess' => 'неверная дата', 'result' => false);
}
$datedelivery = $y . '-' . $m . '-' . $d;
} else {
$datedelivery = '';
}
$db = new ps_DB();
$sql = 'SELECT date_delivery FROM jos_vm_orders WHERE order_id = "' . $order_id . '"';
$db->query($sql);
$prev_datedelivery = $db->loadResult();
$sql = 'UPDATE jos_vm_orders SET date_delivery = "' . $datedelivery . '", customer_note = CONCAT("' . mysql_escape_string($date_full) . '", customer_note) WHERE order_id = "' . $order_id . '"';
$db->query($sql);
$result = array();
$result['mess'] = 'OK';
$result['result'] = true;
$this->orderlog->saveLog($order_id, 'Изменение даты доставки', '', $prev_datedelivery, $datedelivery);
return $result;
}
示例4: saveField
function saveField(&$d)
{
global $my, $mosConfig_live_site, $VM_LANG;
$db = new ps_DB();
if ($d['type'] == 'webaddress') {
$d['rows'] = $d['webaddresstypes'];
if (!($d['rows'] == 0 || $d['rows'] == 2)) {
$d['rows'] = 0;
}
}
$d['name'] = str_replace(" ", "", strtolower($d['name']));
if (!$this->validateOnSave($d)) {
return false;
}
// Prevent unpublishing and renaming of IMPORTANT Fields like "email", "username", "password",...
$fieldObj = $this->get($d['fieldid']);
if ($fieldObj !== false) {
if (in_array($fieldObj->f('name'), $this->getSkipFields())) {
$d['name'] = $fieldObj->f('name');
$d['required'] = $fieldObj->f('required');
$d['published'] = $fieldObj->f('published');
}
}
$fields = array('name' => vmGet($d, 'name'), 'title' => vmGet($d, 'title'), 'description' => vmGet($d, 'description'), 'type' => vmGet($d, 'type'), 'maxlength' => vmGet($d, 'maxlength'), 'size' => vmGet($d, 'size'), 'required' => vmGet($d, 'required'), 'ordering' => vmGet($d, 'ordering'), 'cols' => vmGet($d, 'cols'), 'rows' => vmGet($d, 'rows'), 'value' => vmGet($d, 'value'), 'default' => vmGet($d, 'default'), 'published' => vmGet($d, 'published'), 'registration' => vmGet($d, 'registration'), 'shipping' => vmGet($d, 'shipping'), 'account' => vmGet($d, 'account'), 'readonly' => vmGet($d, 'readonly'), 'calculated' => vmGet($d, 'calculated'), 'params' => vmGet($d, 'params'), 'vendor_id' => vmGet($_SESSION, 'ps_vendor_id', 1));
if (!empty($d['fieldid'])) {
// existing record
$db->buildQuery('UPDATE', '#__{vm}_userfield', $fields, 'WHERE `fieldid` =' . intval($d['fieldid']));
$db->query();
if ($d['type'] != 'delimiter') {
$this->changeColumn($d['name'], $d['cType'], 'update');
}
} else {
// add a new record
$sql = "SELECT MAX(ordering) as max FROM #__{vm}_userfield";
$db->query($sql);
$db->next_record();
$d['ordering'] = $db->f('max') + 1;
$db->buildQuery('INSERT', '#__{vm}_userfield', $fields);
$db->query();
$_REQUEST['fieldid'] = $db->last_insert_id();
if ($d['type'] != 'delimiter') {
$this->changeColumn($d['name'], $d['cType'], 'add');
}
}
$fieldNames = vmGet($d, 'vNames', array());
$fieldValues = vmGet($d, 'vValues', array());
$j = 1;
if (!empty($d['fieldid'])) {
$db->query("DELETE FROM #__{vm}_userfield_values" . " WHERE fieldid=" . (int) $d['fieldid'] . ' LIMIT 1');
} else {
$db->query("SELECT MAX(fieldid) as max FROM `#__{vm}_userfield`");
$maxID = $db->loadResult();
$d['fieldid'] = $maxID;
}
$n = count($fieldNames);
for ($i = 0; $i < $n; $i++) {
if (trim($fieldNames[$i]) != null || trim($fieldNames[$i]) != '') {
$fields = array('fieldid' => (int) $d['fieldid'], 'fieldtitle' => htmlspecialchars($fieldNames[$i]), 'fieldvalue' => htmlspecialchars($fieldValues[$i]), 'ordering' => $j);
$db->buildQuery('INSERT', '#__{vm}_userfield_values', $fields);
$db->query();
$j++;
}
}
$GLOBALS['vmLogger']->info($VM_LANG->_('VM_USERFIELD_SAVED'));
return true;
}
示例5: changeShipping
function changeShipping($order_id, $r)
{
global $VM_LANG, $vmLogger;
require_once CLASSPATH . 'ps_orderlog.php';
$orderlog = new ps_orderlog();
$d = array();
$ship_method_id = $r['shipping_rate_id'];
$ship_method_id = @urldecode($ship_method_id);
$d["ship_method_id"] = $ship_method_id;
$shipping_rate_id_ar = explode('|', $ship_method_id);
//Inf Получение названия ТК
$transportnaya_company = htmlspecialchars($r['transportnaya_company'], ENT_QUOTES);
if (!empty($transportnaya_company)) {
if ($shipping_rate_id_ar[1] == 'Доставка транспортной компанией') {
$shipping_rate_id_ar[2] .= $transportnaya_company;
}
$d["ship_method_id"] = implode('|', $shipping_rate_id_ar);
}
$d['order_shipping'] = $shipping_rate_id_ar[3];
$db = new ps_DB();
$q = "SELECT ship_method_id FROM #__{vm}_orders WHERE order_id = '" . $order_id . "'";
$db->query($q);
$prev_ship_method_id = $db->loadResult();
$db->buildQuery('UPDATE', '#__{vm}_orders', $d, ' WHERE order_id=' . $order_id);
$result = $db->query();
$ps_order_change = new ps_order_change($order_id);
$ps_order_change->recalc_order($order_id);
if ($prev_ship_method_id != $ship_method_id) {
$orderlog->saveLog($order_id, 'Изменение варианта доставки', '', $prev_ship_method_id, $ship_method_id);
}
}
示例6: time
//.........这里部分代码省略.........
$dbu->query( $q );
}
else {
$q = "UPDATE #__{vm}_product
SET product_in_stock=product_in_stock+".$db->f("product_quantity").",
product_sales=product_sales-".$db->f("product_quantity")."
WHERE product_id=".$db->f("product_id");
$dbu->query( $q );
}
}
}
// Update the Order Items' status
$q = "SELECT order_item_id FROM #__{vm}_order_item WHERE order_id=".$db->getEscaped($d['order_id']);
$db->query($q);
$dbu = new ps_DB;
while ($db->next_record()) {
$item_id = $db->f("order_item_id");
$fields =array( 'order_status'=> $d["order_status"],
'mdate'=> $timestamp );
$dbu->buildQuery('UPDATE', '#__{vm}_order_item', $fields, "WHERE order_item_id='" .(int)$item_id . "'");
$dbu->query();
}
if ($d["order_status"] == "C" || $d["order_status"] == "P")
{
//////////////////////////////////////////////////////////////////////////
// OSE added
//////////////////////////////////////////////////////////////////////////
//////////////Joomla Database Class//////////////
require_once(JPATH_SITE.DS.'components'.DS.'com_osemsc'.DS.'init.php');
require_once(JPATH_SITE.DS.'components'.DS.'com_osemsc'.DS.'helpers'.DS.'oseMscPublic.php');
$jdb = &JFactory::getDBO();
$jquery = "SELECT user_id FROM `#__vm_orders` WHERE `order_id` = '" . $db->getEscaped($d['order_id']) . "'";
$jdb->setQuery($jquery);
$user_id = $jdb->loadResult();
$jquery = "SELECT a.product_id, b.category_id FROM `#__vm_order_item` as a, `#__vm_product_category_xref` as b WHERE a.`order_id` = '" . $db->getEscaped($d['order_id']) . "' AND a.`product_id` = b.`product_id`";
$jdb->setQuery($jquery);
$results = $jdb->loadObjectList();
$cart = oseMscPublic::getCart();
if (empty($results))
{
$jquery = "SELECT a.product_id, b.category_id, c.product_parent_id FROM `#__vm_order_item` as a, `#__vm_product_category_xref` as b, `#__vm_product` as c WHERE a.`order_id` = '" . $db->getEscaped($d['order_id']) . "' AND a.`product_id` = c.`product_id` AND b.`product_id` = c.`product_parent_id`";
$jdb->setQuery($jquery);
$results = $jdb->loadObjectList();
}
foreach ($results as $result)
{
//////////////////////////////////////////////////
$product_id = $result->product_id;
$jquery = "SELECT * FROM `#__osemsc_ext` WHERE `type` = 'vm'";
$jdb->setQuery($jquery);
$jdb->query();
$rows = $jdb->loadObjectList();
foreach ($rows as $row)
{
$msc_data = oseJson::decode($row->params);
$left_var = "";
$right_var = "";
if ($msc_data->category_id > 0)
{
$left_var = $result->category_id;
$right_var = $msc_data->category_id;
}
else
{
$left_var = $result->product_id;