thinkphp implementation of Bulk Delete data principle is very simple, just on the template page to write This is an array, and the action's delete function del () is as follows:
/**** Delete function supports deleting multiple and one **/function del () { //dump ($_get[' id ')); $name = Strtolower ($_get[' _url_ '][0]); Gets the current module name $name = $this->getactionname (); $model = D ($name);//Gets the operand of the current module $id = $_get[' id ']; Determines whether the ID is an array or a numeric if (Is_array ($id)) { $where = ' id in ('. Implode (', ', $id) ') '; } else{ $where = ' id= '. $id; } Dump ($where); $list = $model->where ($where)->delete (); if ($list!==false) { $this->success ("successfully deleted {$list} bar! "); } else{ $this->error (' Delete failed! '); }}
http://www.bkjia.com/PHPjc/824660.html www.bkjia.com true http://www.bkjia.com/PHPjc/824660.html techarticle thinkphp Implementation of the bulk delete data principle is very simple, simply write input name= ' id[] ' type= ' checkbox ' value= ' {$vo. ID} ' class= ' in the template page This is an array ...