我有以下数组,我正在尝试保存到数据库..
$this->ProgramApplication->saveMany($priApps);
$priApps:
Array
(
[0] => Array
(
[ProgramCurrentResidence] => Array
(
[program_id] => 3698076220130520
[customer_id] => jraer4081
[residence_duration] => 61-90-days
[residence_stability] => renting-leasing
[payment_current] => yes
[payment_amount_past_due] =>
[landlord_name] => Blake Woods
[landlord_phone] => (269)777-7777
[landlord_fax] =>
[notes] =>
)
[ProgramPreviousResidence] => Array
(
[program_id] => 3698076220130520
[customer_id] => jrayner4081
[residence_duration] => 1year
[street_address] => 1637 Colfax Ave
[city] => The Harbor
[state] => me
[zip] => 49022
)
)
)
不断抛出以下错误......
数据库错误 错误:SQLSTATE [42S22]:找不到列:1054'where子句'中的未知列'ProgramCurrentResidence.program_id'
SQL查询:SELECT ProgramApplication
。program_id
,ProgramApplication
。customer_id
,ProgramApplication
。secondary_customer_id
,ProgramApplication
。{ {1}},secondary_customer_relationship
。ProgramApplication
,sales_associate
。ProgramApplication
,store
。ProgramApplication
,created_on
。{{1 },ProgramApplication
。date_submitted
,ProgramApplication
。date_delivered
,ProgramApplication
。stock_number
,ProgramApplication
。deal_status
,ProgramApplication
。deal_status_conditional_reasoning
,ProgramApplication
。transfered_to_dealpack
,ProgramApplication
。presubmittal_notes
,ProgramApplication
。underwriters_notes
FROM { {1}}。ProgramApplication
AS modified_by
WHERE((expreta2_x12
。programs
='3698076220130520')和(ProgramApplication
。ProgramCurrentResidence
=' jrayner4081'))LIMIT 1
这是我的ProgramCurrentResidence模型......
program_id
程序应用程序模型中的一些代码
ProgramCurrentResidence
这可能是你所说的..
customer_id
我知道该表包含所使用的每个字段但由于某种原因它继续吐出此错误?我假设它的模型,但我可能是错的。
答案 0 :(得分:0)
您似乎正在对ProgramApplication进行查找,而ProgramApplication中的模型与ProgramCurrentResidence没有任何关系。 您可能需要向ProgramApplication模型添加hasOne或hasMany of ProgramCurrentResidence。