tp5 的單個刪除和批量刪除

2021-09-05 01:23:24 字數 1068 閱讀 4965

不多說了直接上**:

頁面html:

查詢

樣式css:

/* show頁面樣式 */

.sh_dv

.sh_dv_tay

.dv_select{}

.input_sb

.input_sel

.input_btn

.input_btn:hover

.sh_dv_contact

.sh_ul

.sh_li

.sh_li_name

.sh_li_email

.sh_li_contact

.sh_li_time

.sh_li_del

.del

.del:hover

.delall

.delall:hover

.sh_li_tibtn

.time_border

/*反*/

.the .time_left

.the .time_right

/*正*/

.is .time_left

.is .time_right

後端方法:

//條件查詢    空值查詢

public function show( $inp = null,$val=null)

if($inp == null || $val == null)

return $this->fetch();

}//刪除單個

public function del($id)

if(!empty($id) && in_array($id,$locar))else

return $msg2;

}//批量刪除

public function delall()else

}return json_encode(['msg' => 'false']);

}

作為參考,感謝前人的文章:

TP5 軟刪除功能

參考 tp5 完全開發手冊 軟刪除 在實際專案中,對資料頻繁使用刪除操作會導致效能問題,軟刪除的作用就是把資料加上刪除標記,而不是真正的刪除,同時也便於需要的時候進行資料的恢復。使用軟刪除功能,需要在物件模型中引入use traits model softdelete 並定義軟刪除標記字段prote...

layui實現單個刪除和批量刪除

二 批量刪除 使用者列表 列表操作 ajaxres負責響應給頁面是否成功 public class ajaxres public void setsuccess boolean success public string getmsg public void setmsg string msg 刪除...

tp5查詢,新增,刪除語句

tp5新增 use think db db name 表名 isert input post.db table 完整表名 isert input post.db 表名 insert input post.tp5查詢 引入助手函式 use think db 找到模型的位置 查詢id 1點全部資料資訊 ...