-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDxDataTreeAction.class.php
More file actions
39 lines (35 loc) · 1.34 KB
/
DxDataTreeAction.class.php
File metadata and controls
39 lines (35 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
class DxDataTreeAction extends DataOpeAction {
public function getSelectSelectSelect(){
$list = $this->model->getSelectSelectSelect();
echo json_encode($list);
}
public function index(){
$this->assign('dx_data_list', DXINFO_PATH."/DxTpl/data_list.html");
$dataListHtml = $this->fetch("data_list");
echo $this->display("Public:header");
if($this->haveHeaderMenu){
echo $this->display("Public:menu");
}
echo $dataListHtml.$this->display("Public:footer");
}
/** 通过ajax提交删除请求 **/
public function delete(){
$deleteState = false;
$model = $this->model;
if (! empty ( $model )) {
$id = $_REQUEST["id"];
if (intval ( $id )>0) {
$pk = $model->getPk ();
$condition = array($pk=>intval($id));
$list = $model->where ( $condition )->find();
if($list){
$model->where ( array("fdn"=>array("like",$list["fdn"]."%")) )->delete();
$deleteState = true;
}
}
}
if($deleteState) $this->ajaxReturn(array("data"=>0,"info"=>"删除成功!","status"=>1),"JSON");
else $this->ajaxReturn(array("data"=>0,"info"=>"删除失败!","status"=>0),"JSON");
}
}