We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

This a Bug?

    $criteria->inWhere('shop_id',$shopIds);
    $criteria->limit(20,0);
    //获取店铺结果集
    $pageshop = $this->getModel('shopSku')->find($criteria->getParams());

    Plus $criteria->limit can not get the result, get rid of the problem, which is BUG?


3.5k
Accepted
answer

Try code bellow

$criteria = shopSku::query();
$criteria->inWhere('shop_id', $shopIds)
$criteria->limit(20,0)
$pageshop = $criteria->execute();

Try code bellow

$criteria = shopSku::query();
$criteria->inWhere('shop_id', $shopIds)
$criteria->limit(20,0)
$pageshop = $criteria->execute();

$this->getModel('shopSku')

Or not

Try code bellow

$criteria = shopSku::query();
$criteria->inWhere('shop_id', $shopIds)
$criteria->limit(20,0)
$pageshop = $criteria->execute();

$criteria = $this->getModel('shopSku')->query(); $criteria->inWhere('shop_id', $shopIds) $criteria->limit(20,0) $pageshop = $criteria->execute();

Which class is $this ? In controller or view i don't remeber method getModel and don't remeber service 'model' in common services

Try code bellow

$criteria = shopSku::query();
$criteria->inWhere('shop_id', $shopIds)
$criteria->limit(20,0)
$pageshop = $criteria->execute();

$this->getModel('shopSku')

Or not

GetModel is my own way to encapsulate the Model instance of the framework itself.

Which class is $this ? In controller or view i don't remeber method getModel and don't remeber service 'model' in common services

Try code bellow

$criteria = shopSku::query();
$criteria->inWhere('shop_id', $shopIds)
$criteria->limit(20,0)
$pageshop = $criteria->execute();

$this->getModel('shopSku')

Or not