在下面的代码中,当我得到完整的零结果pr零行时,我遇到此错误:
Unable to find table class for current entity error
如果分页中出现任何一行,那么时间一切正常。 我在哪里做错了?
$prProductFind=$this->PurchaseRequisitionProducts
->find()
->where([$condn,$conditions])
->matching('PurchaseOrderProducts', function(\Cake\ORM\Query $q) {
return $q->where(['PurchaseOrderProducts.id IS NOT NULL']);
})
->matching('PurchaseOrderProducts.PurchaseOrder', function(\Cake\ORM\Query $q) {
return $q->where(['PurchaseOrder.id IS NOT NULL','PurchaseOrder.is_approve'=>"Y",'PurchaseOrder.po_type'=>1,'PurchaseOrder.status'=>1]);
})
->group(['PurchaseRequisitionProducts.id'])
->order(["PurchaseRequisitionProducts.id"=>"desc"]);
$pr_product = $this->paginate($prProductFind);