Commit 232ab765 authored by Artem Malichev's avatar Artem Malichev

Minor fix

parent 48c369bc
......@@ -129,13 +129,7 @@ class iaProduct extends abstractModuleFront
protected function _get($where = null, $start, $limit, $order = null)
{
$where || $where = iaDb::EMPTY_CONDITION;
if (iaUsers::hasIdentity()) {
$userId = iaUsers::getIdentity()->id;
$where .= ' AND p.`member_id` = :member_id';
} else {
$where .= ' AND p.`status` != :hidden';
}
$where .= ' AND p.`status` != :hidden';
$this->iaDb->bind($where, ['hidden' => self::STATUS_HIDDEN, 'member_id' => isset($userId) ? $userId : 0]);
......
......@@ -20,12 +20,7 @@ if ($iaView->url && 'commerce' == $iaCore->get('default_package')) {
case '.html':
// product
if (iaUsers::hasIdentity()) {
$userId = iaUsers::getIdentity()->id;
$stmt = '`slug` = :slug AND `member_id` = :member_id';
} else {
$stmt = '`slug` = :slug AND `status` != :status';
}
$stmt = '`slug` = :slug AND `status` != :status';
$iaDb->bind($stmt, ['slug' => end($iaView->url), 'status' => 'hidden', 'member_id' => isset($userId) ? $userId : 0]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment