客户列表数据源读取条件bug修正

This commit is contained in:
hdm 2022-08-03 18:06:52 +08:00
parent c264c5cc88
commit bdc795c81e
4 changed files with 13 additions and 11 deletions

View File

@ -71,11 +71,11 @@ class Api extends BaseController
$data['delete_time'] = -1; $data['delete_time'] = -1;
} }
if (Db::name('Customer')->update($data) !== false) { 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); Db::name('CustomerLog')->strict(false)->field(true)->insert($log_data);
return to_assign(0, "删除成功"); return to_assign();
} else { } else {
return to_assign(1, "删除失败"); return to_assign(1, "操作失败");
} }
} else { } else {
return to_assign(1, "错误的请求"); return to_assign(1, "错误的请求");
@ -94,7 +94,7 @@ class Api extends BaseController
$data['id'] = $params['id']; $data['id'] = $params['id'];
$data['delete_time'] = 0; $data['delete_time'] = 0;
if (Db::name('Customer')->update($data) !== false) { if (Db::name('Customer')->update($data) !== false) {
add_log('recovery', $params['id']); add_log('recovery', $params['id'],[],'客户');
$log_data = array( $log_data = array(
'field' => 'del', 'field' => 'del',
'action' => 'recovery', 'action' => 'recovery',
@ -104,9 +104,9 @@ class Api extends BaseController
'create_time' => time(), 'create_time' => time(),
); );
Db::name('CustomerLog')->strict(false)->field(true)->insert($log_data); Db::name('CustomerLog')->strict(false)->field(true)->insert($log_data);
return to_assign(0, "删除成功"); return to_assign();
} else { } else {
return to_assign(1, "删除失败"); return to_assign(1, "操作失败");
} }
} else { } else {
return to_assign(1, "错误的请求"); return to_assign(1, "错误的请求");

View File

@ -35,8 +35,8 @@ class Index extends BaseController
$uid = $this->uid; $uid = $this->uid;
$auth = isAuth($uid,'customer_admin'); $auth = isAuth($uid,'customer_admin');
$dids = get_department_son($this->did,0);
if($auth==0){ if($auth==0){
$dids = get_department_son($this->did,0);
if($tab==1){ if($tab==1){
$whereOr[] =['a.belong_uid', '=', $uid]; $whereOr[] =['a.belong_uid', '=', $uid];
} }
@ -57,7 +57,6 @@ class Index extends BaseController
} }
} }
else if($auth==1){ else if($auth==1){
$dids = get_department_son($this->did,0);
if($tab==1){ if($tab==1){
$whereOr[] =['a.belong_uid', '=', $uid]; $whereOr[] =['a.belong_uid', '=', $uid];
} }
@ -69,6 +68,9 @@ class Index extends BaseController
else if($tab==3){ else if($tab==3){
$whereOr[] = ['', 'exp', Db::raw("FIND_IN_SET('{$uid}',a.share_ids)")]; $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']; $rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];

View File

@ -170,7 +170,7 @@
obj.del(); 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); layer.close(index);
}); });
} }

View File

@ -117,7 +117,7 @@
obj.del(); obj.del();
} }
} }
tool.post("/customer/index/revert", {id: data.id}, callback); tool.post("/customer/api/revert", {id: data.id}, callback);
layer.close(index); layer.close(index);
}); });
} }
@ -132,7 +132,7 @@
obj.del(); 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); layer.close(index);
}); });
} }