|
@@ -22,7 +22,11 @@ use think\facade\Db;
|
|
|
class LivingAllowance extends AdminController {
|
|
|
|
|
|
public function index() {
|
|
|
- $enterpriseList = EnterpriseApi::getSimpleList();
|
|
|
+ if ($this->user["type"] == CommonConst::ENTERPRISE_NORMAL) {
|
|
|
+ $enterpriseList = EnterpriseApi::getMultipleList([CommonConst::ENTERPRISE_NORMAL, CommonConst::ENTERPRISE_WJ, CommonConst::ENTERPRISE_GJ]);
|
|
|
+ } else {
|
|
|
+ $enterpriseList = EnterpriseApi::getSimpleList();
|
|
|
+ }
|
|
|
$provinceList = \app\common\api\LocationApi::findProvinceSelect();
|
|
|
$process = $this->request->param("process");
|
|
|
$message = [];
|
|
@@ -140,6 +144,9 @@ class LivingAllowance extends AdminController {
|
|
|
case 4:
|
|
|
break;
|
|
|
}
|
|
|
+ if (!in_array($this->user["type"], [CommonConst::ENTERPRISE_NORMAL, CommonConst::ENTERPRISE_JC])) {
|
|
|
+ $responseObj->msg = "当前账号类型没有操作权限";
|
|
|
+ }
|
|
|
if ($responseObj->code == 500) {
|
|
|
return json($responseObj);
|
|
|
}
|
|
@@ -182,6 +189,10 @@ class LivingAllowance extends AdminController {
|
|
|
$responseObj->msg = "系统错误,请联系管理员";
|
|
|
return json($responseObj);
|
|
|
}
|
|
|
+ if (!in_array($this->user["type"], [CommonConst::ENTERPRISE_NORMAL, CommonConst::ENTERPRISE_JC])) {
|
|
|
+ $responseObj->msg = "当前账号类型没有操作权限";
|
|
|
+ return json($responseObj);
|
|
|
+ }
|
|
|
if (!$obj["checkState"]) {
|
|
|
$responseObj->msg = "请选择审核状态";
|
|
|
return json($responseObj);
|
|
@@ -227,6 +238,10 @@ class LivingAllowance extends AdminController {
|
|
|
$ids = trim($this->request->param("ids"));
|
|
|
$msg = trim($this->request->param("msg"));
|
|
|
$ids = array_filter(explode(",", $ids));
|
|
|
+ if (!in_array($this->user["type"], [CommonConst::ENTERPRISE_NORMAL, CommonConst::ENTERPRISE_JC])) {
|
|
|
+ $responseObj->msg = "当前账号类型没有操作权限";
|
|
|
+ return json($responseObj);
|
|
|
+ }
|
|
|
if (!$ids) {
|
|
|
$responseObj->msg = "请选择需要设置审核不通过的数据";
|
|
|
return json($responseObj);
|
|
@@ -297,6 +312,10 @@ class LivingAllowance extends AdminController {
|
|
|
$responseObj->msg = "系统错误,请联系管理员!";
|
|
|
return json($responseObj);
|
|
|
}
|
|
|
+ if (!in_array($this->user["type"], [CommonConst::ENTERPRISE_NORMAL, CommonConst::ENTERPRISE_JC])) {
|
|
|
+ $responseObj->msg = "当前账号类型没有操作权限";
|
|
|
+ return json($responseObj);
|
|
|
+ }
|
|
|
$oldInfo = \app\common\api\LivingAllowanceApi::getInfoById($id);
|
|
|
$oldState = $oldInfo["checkState"];
|
|
|
|
|
@@ -473,12 +492,16 @@ class LivingAllowance extends AdminController {
|
|
|
$sex = $this->request->param("sex");
|
|
|
$checkState = $this->request->param("checkState");
|
|
|
|
|
|
- if (!in_array($user["type"], [1, 2])) {
|
|
|
+ if (!in_array($user["type"], [CommonConst::ENTERPRISE_NORMAL, CommonConst::ENTERPRISE_JC])) {
|
|
|
$response->msg = "当前账号类型没有操作权限";
|
|
|
return json($response);
|
|
|
}
|
|
|
$where = [];
|
|
|
- $where[] = ["type", "=", $user["type"]];
|
|
|
+ if ($user["type"] == CommonConst::ENTERPRISE_NORMAL) {
|
|
|
+ $where[] = ["type", "in", [CommonConst::ENTERPRISE_NORMAL, CommonConst::ENTERPRISE_WJ, CommonConst::ENTERPRISE_GJ]];
|
|
|
+ } else {
|
|
|
+ $where[] = ["type", "=", $user["type"]];
|
|
|
+ }
|
|
|
if ($name) {
|
|
|
$where[] = ["name", "like", "%" . $name . "%"];
|
|
|
}
|
|
@@ -527,7 +550,7 @@ class LivingAllowance extends AdminController {
|
|
|
|
|
|
$request = $this->request;
|
|
|
$user = $this->user;
|
|
|
- if (!in_array($user["type"], [1, 2])) {
|
|
|
+ if (!in_array($user["type"], [CommonConst::ENTERPRISE_NORMAL, CommonConst::ENTERPRISE_JC])) {
|
|
|
$response->msg = "当前账号类型没有操作权限";
|
|
|
return \StrUtil::back($response, "LivingAllowanceInfo.callBack");
|
|
|
}
|
|
@@ -539,7 +562,11 @@ class LivingAllowance extends AdminController {
|
|
|
$keys = array_filter(explode(",", $values)); //标题对应的字段
|
|
|
|
|
|
$where = [];
|
|
|
- $where[] = ["type", "=", $user["type"]];
|
|
|
+ if ($user["type"] == CommonConst::ENTERPRISE_NORMAL) {
|
|
|
+ $where[] = ["type", "in", [CommonConst::ENTERPRISE_NORMAL, CommonConst::ENTERPRISE_WJ, CommonConst::ENTERPRISE_GJ]];
|
|
|
+ } else {
|
|
|
+ $where[] = ["type", "=", $user["type"]];
|
|
|
+ }
|
|
|
if ($_where = LivingAllowanceApi::setLivingAllowanceCheckStateCondition($request->param())) {
|
|
|
$where = array_merge($where, $_where);
|
|
|
}
|
|
@@ -779,7 +806,7 @@ class LivingAllowance extends AdminController {
|
|
|
$response = new \stdClass();
|
|
|
$response->code = 500;
|
|
|
$user = $this->user;
|
|
|
- if (!in_array($user["type"], [1, 2])) {
|
|
|
+ if (!in_array($user["type"], [CommonConst::ENTERPRISE_NORMAL, CommonConst::ENTERPRISE_JC])) {
|
|
|
$response->msg = "当前账号类型没有操作权限";
|
|
|
return \StrUtil::back($response, "LivingAllowanceInfo.callBack");
|
|
|
}
|
|
@@ -865,7 +892,7 @@ class LivingAllowance extends AdminController {
|
|
|
$response = new \stdClass();
|
|
|
$response->code = 500;
|
|
|
$user = $this->user;
|
|
|
- if (!in_array($user["type"], [1, 2])) {
|
|
|
+ if (!in_array($user["type"], [CommonConst::ENTERPRISE_NORMAL, CommonConst::ENTERPRISE_JC])) {
|
|
|
$response->msg = "当前账号类型没有操作权限";
|
|
|
return \StrUtil::back($response, "LivingAllowanceInfo.callBack");
|
|
|
}
|
|
@@ -873,7 +900,11 @@ class LivingAllowance extends AdminController {
|
|
|
$endTime = $this->request["endTime"];
|
|
|
$where = [];
|
|
|
$where[] = ["publicBatch", "between", [$startTime, $endTime]];
|
|
|
- $where[] = ["type", "=", $user["type"]];
|
|
|
+ if ($user["type"] == CommonConst::ENTERPRISE_NORMAL) {
|
|
|
+ $where[] = ["type", "in", [CommonConst::ENTERPRISE_NORMAL, CommonConst::ENTERPRISE_WJ, CommonConst::ENTERPRISE_GJ]];
|
|
|
+ } else {
|
|
|
+ $where[] = ["type", "=", $user["type"]];
|
|
|
+ }
|
|
|
$list = LaModel::where($where)->order("publicBatch")->select()->toArray();
|
|
|
if (!$list) {
|
|
|
$response->msg = "所选时间段内无公示数据";
|