本文整理匯總了PHP中Price::updateField方法的典型用法代碼示例。如果您正苦於以下問題:PHP Price::updateField方法的具體用法?PHP Price::updateField怎麽用?PHP Price::updateField使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Price
的用法示例。
在下文中一共展示了Price::updateField方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setList
public static function setList($list)
{
$sql = 'UPDATE {{catalog}} SET available=0';
DB::exec($sql);
foreach ($list as $partname => $items) {
$sql = 'SELECT tree FROM {{catalog}} WHERE partname="' . $partname . '"';
$parent = DB::getOne($sql);
if ($parent) {
$available = 0;
foreach ($items as $size => $item) {
$sql = 'SELECT id FROM {{tree}} WHERE parent=' . $parent . ' AND name="' . $size . '"';
$tree = DB::getOne($sql);
if (!$tree) {
$sql = 'SELECT id FROM {{tree}} WHERE parent=' . $parent . ' AND path="' . $size . '"';
$tree = DB::getOne($sql);
}
foreach ($item as $k => $f) {
$sql = 'SELECT type FROM {{fields}} WHERE module=6 AND path="' . $k . '"';
$r = DB::getOne($sql);
$row = array('field' => Fields::$types[$r]['type'], 'path' => $k, 'value' => $f);
Price::updateField($tree, $row);
if ($k == 'numberRetailSales' && $f > 0) {
$available = 1;
}
}
}
$sql = 'UPDATE {{catalog}} SET available=' . $available . ' WHERE tree=' . $parent;
DB::exec($sql);
}
}
}