本文整理匯總了PHP中Products::RecalcSitePrices方法的典型用法代碼示例。如果您正苦於以下問題:PHP Products::RecalcSitePrices方法的具體用法?PHP Products::RecalcSitePrices怎麽用?PHP Products::RecalcSitePrices使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Products
的用法示例。
在下文中一共展示了Products::RecalcSitePrices方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: UpdateSinglePrice
public function UpdateSinglePrice($id_user, $single_price, $price = false)
{
$f['single_price'] = $single_price;
$this->db->StartTrans();
if (!$this->db->Update(_DB_PREFIX_ . 'supplier', $f, "id_user = " . $id_user)) {
$this->db->FailTrans();
return false;
}
unset($f);
if ($single_price == 1) {
$Suppliers = new Suppliers();
$Suppliers->SetFieldsById($id_user, 1);
$supplier = $Suppliers->fields;
$f['price_opt_otpusk'] = 'price_mopt_otpusk';
$f['price_opt_otpusk_usd'] = 'price_mopt_otpusk_usd';
$f['price_opt_recommend'] = 'price_mopt_otpusk*' . $supplier['koef_nazen_opt'];
if (!($succesUpdate = $this->db->UpdatePro(_DB_PREFIX_ . 'assortiment', $f, "id_supplier = " . $id_user))) {
$this->db->FailTrans();
return false;
}
}
$this->db->CompleteTrans();
if (isset($succesUpdate)) {
$res = $this->GetAssortimentProductIds($id_user);
$arr = array();
foreach ($res as $v) {
$arr[] = $v['id_product'];
}
$Products = new Products();
if (!$Products->RecalcSitePrices($arr)) {
return false;
}
}
return true;
}
示例2: Products
<?if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'){
// header('Content-Type: text/javascript; charset=utf-8');
$Products = new Products();
if(isset($_POST['action'])){
switch($_POST['action']){
case "decline":
$Products->SetModerationStatus($_POST['id'], $_POST['status'], nl2br($_POST['comment']));
break;
case "accept":
$_POST['art'] = $Products->CheckArticle($Products->GetLastArticle());
$id = $Products->AcceptProductModeration($_POST);
$Products->UpdateProductCategories($id, $_POST['category'], 1);
$Products->RecalcSitePrices(array($id));
$Products->SetModerationStatus($_POST['id'], $_POST['status']);
break;
default:
break;
}
}
exit();
}?>