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

I using curd to show CGridview I join 2 table in my computer it work

but when deploy to linux server not work what wrong? ,help me pls!!

in controller

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)
                          );

this error

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个回答



哼哼只是猜测你是否尊重中的模型名称 group </ code>中的情况< / code> criteria?</ p>

Linux区分大小写,因此如果您在关系名称或模型中放入 group </ code>而不是 Group </ code> 可能发生错误的关系的名称。</ p>
</ div>

展开原文

原文

Hum just a guess are you respecting the case in the model name group in your with criteria?

Linux is case sensitive so if you put group instead of Group in your relation name or in the model name of the relation an error could occur.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问