在cakephp 3中,同一个外键的一个模型中有多个belongsTo关系

时间:2018-05-17 11:50:32

标签: cakephp cakephp-3.0 cakephp-3.x cakephp-3.2 cakephp-3.3

我有一个模型SupplierInquiry有很多SupplierInquiryProducts,在SupplierInquiryProducts表中我有product_id外键和product_id可以来自很多模型。 我已在SupplierInquiryProducts中应用了关系,如下所示

static class MyIterator extends AbstractSpliterator<String> {

    private Matcher matcher;

    public MyIterator(Matcher matcher) {
        // I can't think of a better way to estimate the size here
        // may be you can figure a better one here
        super(matcher.regionEnd() - matcher.regionStart(), 0);
        this.matcher = matcher;
    }

    @Override
    public boolean tryAdvance(Consumer<? super String> action) {
        while (matcher.find()) {
            action.accept(matcher.group());
            return true;
        }

        return false;
    }
}

此时,两者都属于不工作状态,而且对于应用条件,它给出了未找到列的错误:1054未知列''on clause'中的'SupplierInquiry.inquiry_type'

1 个答案:

答案 0 :(得分:0)

未找到列:1054未知列''on clause'中的'SupplierInquiry.inquiry_type'

此错误的原因是您的supplier_inquiry数据库中的query_type可能会丢失,重新烘焙模型也可以解决您的问题。

相关问题