0
我正在使用cakephp的網站上工作,該項目在localhost上完美工作,但是當我上傳到我的CONTABO VPS時,我發現了一個問題(hasmany)我失去了關係模型的船舶之間cakephp:hasmany在localhost上工作,但不工作在我的VPS contabo
型號舉例:
public $belongsTo = array(
'category' => array(
'className' => 'categories',
'foreignKey' => 'id_category'
)
);
public $hasMany = array(
'model_globale' => array(
'className' => 'model_globales',
'foreignKey' => 'id_type'
),
'typejobe' => array(
'className' => 'typejobes',
'foreignKey' => 'id_type'
)
);
所以whene我在localhost調試我得到這個:
\app\Controller\ModelesController.php (line 70)
array(
(int) 0 => array(
'type' => array(
'id' => '1',
'name' => 'carte de visite',
'id_category' => '1',
'created' => '0000-00-00 00:00:00'
),
'category' => array(
'id' => '1',
'name' => 'Imprimerie',
'created' => '0000-00-00 00:00:00'
),
'model_globale' => array(
(int) 0 => array(
'id' => '22',
'id_type' => '1',
'id_job' => '1',
'id_chart_graphique' => '0',
'id_user' => '8',
'id_subtype' => '3',
'source' => '0',
'created' => '2014-01-07 09:57:39',
'modified' => '2014-01-07 09:57:39'
)
),
'typejobe' => array(
(int) 0 => array(
'id_type' => '1',
'id_jobe' => '1'
),
(int) 1 => array(
'id_type' => '1',
'id_jobe' => '2'
),
(int) 2 => array(
'id_type' => '1',
'id_jobe' => '5'
)
)
)
)
但我CONTABO VPS WH恩我調試我只得到:
array(
(int) 0 => array(
'type' => array(
'id' => '1',
'name' => 'carte de visite',
'id_category' => '1',
'created' => '0000-00-00 00:00:00'
)
)
)
確保你在這兩個環境中都有相同的數據 –
@MoyedAnsari先生我說我做了複製和過去! – user3169171
所以你在數據庫中有相同的行嗎? –