YII 批量添加 刪除操作

批量添加

	public function db_add($row)
    {
        $msg['state']=false;
        $this->isNewRecord=true;
        $this->cailiao=$row['cailiao'];
        if($this->validate()&&$this->insert()){
            $msg['state']=true;
        }else{
            $msg['msg']=array_values($this->getErrors());
        }
        $this->pkid=0;
        return $msg;
    }

批量刪除

self::deleteAll(['not in','pkid',$rows_pkid])
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章