yii连接表使用关系部署到Linux无法正常工作

时间:2014-03-24 06:26:21

标签: php sql linux yii

我使用curd来显示CGridview我在我的计算机中加入了2个表吗

但是当部署到linux服务器时不能正常工作有什么不对? ,帮帮我!

控制器中的

myController


    $model=new UserLogin('search');
    $model->unsetAttributes(); 
    $dataProvider = new CActiveDataProvider('UserLogin', array( 
                        'criteria' => array(
                        'with'=>'group', 
                    ), 
                        'pagination' => array(
                        'pageSize' => 20, 
                    ),
                ));

        $this->render('admin', array(
            'dataProvider'=>$dataProvider,'model'=>$model)
                          );

此错误

Invalid argument supplied for foreach()

/data/home/nueng/www/html/framework/db/ar/CActiveFinder.php(466)

454 
455     /**
456      * Performs lazy find with the specified base record.
457      * @param CActiveRecord $baseRecord the active record whose related object is to be fetched.
458      */
459     public function lazyFind($baseRecord)
460     {
461         if(is_string($this->_table->primaryKey))
462             $this->records[$baseRecord->{$this->_table->primaryKey}]=$baseRecord;
463         else
464         {
465             $pk=array();
466             foreach($this->_table->primaryKey as $name)
467                 $pk[$name]=$baseRecord->$name;
468             $this->records[serialize($pk)]=$baseRecord;
469         }
470 

1 个答案:

答案 0 :(得分:0)

嗯,您只是猜测您是否尊重group条件中型号名称with中的案例?

Linux区分大小写,因此如果您在关系名称或关系的型号名称中放置group而不是Group,则可能会发生错误。