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;
} 想不通 很蛋疼最佳答案