大神,速度支援,拜谢

浏览:501 发布日期:2014/04/04 分类:求助交流
    public function recycle() {
        $name=$this->getActionName();
        $model = CM($name);
        $pk = $model->getPk ();
        $id = $_GET [$pk];
        $condition = array ($pk => array ('in', $id ) );
        if (false !== $model->recycle ( $condition )) {

            $this->assign ( "jumpUrl", $this->getReturnUrl () );
            $this->success ( '状态还原成功!' );

        } else {
            $this->error   (  '状态还原失败!' );
        }
    }
求大神解释$model->recycle ( $condition )这是什么意思?
$condition = array ($pk => array ('in', $id ) );这里貌似这条件只是id=??吧,为什么打印数组出现 set 'status'

这是CM函数代码function CM($name){
    static $_model = array();
    if(isset($_model[$name])){
        return $_model[$name];
        
    }
$class=$name."Model";
import('@.Model.' . $className);
    if(class_exists($class)){
        $return=new $class();
    }else{
        $return=M("CommonModel:".$name);
    }
    $_model[$name]=$return;
return $return;
}
想不通 很蛋疼

最佳答案
评论( 相关
后面还有条评论,点击查看>>