mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
fixed stockControl
This commit is contained in:
parent
111b71b961
commit
39769b93d8
@ -263,16 +263,16 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
||||
|
||||
public function stockControl($id, $quantity)
|
||||
{
|
||||
$adv = $this->getAdv($id);
|
||||
$stock = $adv->stock;
|
||||
if ($stock == NULL or $stock == 0) {
|
||||
return 0;
|
||||
} elseif ($stock < $quantity) {
|
||||
return 0;//Adet yetmiyorsa
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
if($adv = $this->getAdv($id))
|
||||
{
|
||||
$stock = $adv->stock;
|
||||
|
||||
if($stock and $stock >= $quantity)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function saveCustomField($category_id, $field_id, $name)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user