Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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.3k
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