diff --git a/app/customer/controller/Api.php b/app/customer/controller/Api.php index a23e6a4..76a84ea 100644 --- a/app/customer/controller/Api.php +++ b/app/customer/controller/Api.php @@ -71,11 +71,11 @@ class Api extends BaseController $data['delete_time'] = -1; } if (Db::name('Customer')->update($data) !== false) { - add_log('delete', $params['id']); + add_log('delete', $params['id'],[],'客户'); Db::name('CustomerLog')->strict(false)->field(true)->insert($log_data); - return to_assign(0, "删除成功"); + return to_assign(); } else { - return to_assign(1, "删除失败"); + return to_assign(1, "操作失败"); } } else { return to_assign(1, "错误的请求"); @@ -94,7 +94,7 @@ class Api extends BaseController $data['id'] = $params['id']; $data['delete_time'] = 0; if (Db::name('Customer')->update($data) !== false) { - add_log('recovery', $params['id']); + add_log('recovery', $params['id'],[],'客户'); $log_data = array( 'field' => 'del', 'action' => 'recovery', @@ -104,9 +104,9 @@ class Api extends BaseController 'create_time' => time(), ); Db::name('CustomerLog')->strict(false)->field(true)->insert($log_data); - return to_assign(0, "删除成功"); + return to_assign(); } else { - return to_assign(1, "删除失败"); + return to_assign(1, "操作失败"); } } else { return to_assign(1, "错误的请求"); diff --git a/app/customer/controller/Index.php b/app/customer/controller/Index.php index 6845bc0..55b4ba6 100644 --- a/app/customer/controller/Index.php +++ b/app/customer/controller/Index.php @@ -35,8 +35,8 @@ class Index extends BaseController $uid = $this->uid; $auth = isAuth($uid,'customer_admin'); + $dids = get_department_son($this->did,0); if($auth==0){ - $dids = get_department_son($this->did,0); if($tab==1){ $whereOr[] =['a.belong_uid', '=', $uid]; } @@ -57,7 +57,6 @@ class Index extends BaseController } } else if($auth==1){ - $dids = get_department_son($this->did,0); if($tab==1){ $whereOr[] =['a.belong_uid', '=', $uid]; } @@ -69,6 +68,9 @@ class Index extends BaseController else if($tab==3){ $whereOr[] = ['', 'exp', Db::raw("FIND_IN_SET('{$uid}',a.share_ids)")]; } + else{ + $whereOr[] =['a.belong_uid', '>', 0]; + } } $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit']; diff --git a/app/customer/view/index/sea.html b/app/customer/view/index/sea.html index e6a6770..fe30e3a 100644 --- a/app/customer/view/index/sea.html +++ b/app/customer/view/index/sea.html @@ -170,7 +170,7 @@ obj.del(); } } - tool.delete("/customer/index/delete", {id: data.id,type:1}, callback); + tool.delete("/customer/api/delete", {id: data.id,type:1}, callback); layer.close(index); }); } diff --git a/app/customer/view/index/trash.html b/app/customer/view/index/trash.html index 48b3540..1950b95 100644 --- a/app/customer/view/index/trash.html +++ b/app/customer/view/index/trash.html @@ -117,7 +117,7 @@ obj.del(); } } - tool.post("/customer/index/revert", {id: data.id}, callback); + tool.post("/customer/api/revert", {id: data.id}, callback); layer.close(index); }); } @@ -132,7 +132,7 @@ obj.del(); } } - tool.delete("/customer/index/delete", {id: data.id,type:2}, callback); + tool.delete("/customer/api/delete", {id: data.id,type:2}, callback); layer.close(index); }); }