2014-01-08 68 views
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' 
     ) 
) 
) 
+0

确保你在这两个环境中都有相同的数据 –

+0

@MoyedAnsari先生我说我做了复制和过去! – user3169171

+0

所以你在数据库中有相同的行吗? –

回答

0

当你主持你的项目的主要问题是体制的变化。

  • WAMP本地主机:不区分大小写
  • LINUX服务器:区分大小写

90%的上迁移问题是由于这一问题。谢谢你检查丢失的帽子,或者你有没有目的的一套。

PS:还有你必须检查的递归属性。

相关问题