The principle of batch data deletion in ThinkPHP is very simple. You only need to write <input name = 'id [] 'Type = 'checkbox' value = '{$ vo on the template page. id} 'class = "noborder"> This is an array. The delete function del () of action is as follows:
/***** The deletion function supports deleting multiple entries and one **/function del () {// dump ($ _ GET ['id']); // $ name = strtolower ($ _ GET ['_ URL _'] [0]); // GET the current Module name $ name = $ this-> getActionName (); $ model = D ($ name); // obtain the operation object of the current module $ id = $ _ GET ['id']; // determine whether the id is an array or a value 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! ");} Else {$ this-> error ('deletion failed! ');}}