2
私は2つのテーブルを持っています。 payment_infos
モデルでcakephp 3連想データ用のqueryBuilder
payment_infos:
id |payer |pay_date |product_price_id |product_price |
$this->belongsTo('ProductPrices', [
'foreignKey' => 'product_price_id',
'className' => 'ProductPrices',
]);
私はこのクエリを持っている:
表1:
product_prices:
id | price |description |pack |display |created |modified |
表2
$query = $this->find('all', [
'contain' => ['ProductPrices']
]));
上記のクエリを実行しているとき、私は次のエラーを取得する:
Warning (512): Association property name "product_price" clashes
with field of same name of table "payment_infos".
You should explicitly specify the "propertyName" option.
[CORE\src\ORM\Association.php, line 722]
がjoinType '=>' INNER'' ''とProductPrices''''が 'className' =>の交換を参照してください。あなたはモデルを生成するためにベーキングコンソールを使用しましたか?また、あなたは何を達成しようとしていますか? – Sam