|
@@ -18,6 +18,7 @@ use app\common\api\UploadApi;
|
|
|
use app\common\api\TalentConditionApi;
|
|
|
use app\common\api\CompanyApi;
|
|
|
use app\common\api\TalentState;
|
|
|
+use app\common\state\ProjectState;
|
|
|
|
|
|
/**
|
|
|
* 需要权限的公共方法放这
|
|
@@ -265,12 +266,12 @@ class Api extends BaseController {
|
|
|
$new_item["createTime"] = $item["updateTime"] ?: $item["createTime"];
|
|
|
$new_list[] = $new_item;
|
|
|
}
|
|
|
- if ($type == \app\common\state\ProjectState::TALENT) {
|
|
|
+ if ($type == ProjectState::TALENT) {
|
|
|
$talentInfo = TalentApi::getOne($mainId);
|
|
|
if ($talentInfo["oldId"]) {
|
|
|
$where = [];
|
|
|
$where[] = ["mainId", "=", $talentInfo["oldId"]];
|
|
|
- $where[] = ["type", "=", \app\common\state\ProjectState::TALENT];
|
|
|
+ $where[] = ["type", "=", ProjectState::TALENT];
|
|
|
$before_list = Db::table("un_talent_checklog")->where($where)->order("createTime desc")->select();
|
|
|
foreach ($before_list as $before_item) {
|
|
|
$new_list[] = [
|
|
@@ -376,7 +377,16 @@ class Api extends BaseController {
|
|
|
$type = $this->request->param("type");
|
|
|
$upload = new \app\common\api\UploadApi();
|
|
|
$file = $this->request->file("fileUrl");
|
|
|
- if (!TalentApi::checkIsEditable($mainId)) {
|
|
|
+ $isFileEditable = false;
|
|
|
+ switch ($type) {
|
|
|
+ case ProjectState::INTEGRAL:
|
|
|
+ $isFileEditable = \app\common\api\IntegralRecordApi::checkIsEditable($mainId);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ $isFileEditable = TalentApi::checkIsEditable($mainId);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (!$isFileEditable) {
|
|
|
$res = ["msg" => "当前状态不能修改附件", "obj" => $index];
|
|
|
echo sprintf("<script>parent.%s(%s);</script>", $backName, json_encode($res));
|
|
|
exit();
|
|
@@ -570,7 +580,7 @@ class Api extends BaseController {
|
|
|
if (!$mainId)
|
|
|
return true;
|
|
|
switch ($type) {
|
|
|
- case 1:
|
|
|
+ case ProjectState::TALENT:
|
|
|
if ($this->user["usertype"] == 2) {
|
|
|
$user_id = $this->user["uid"];
|
|
|
$talent_info = Db::table("new_talent_info")->findOrEmpty($mainId);
|
|
@@ -578,6 +588,14 @@ class Api extends BaseController {
|
|
|
return true;
|
|
|
}
|
|
|
break;
|
|
|
+ case ProjectState::INTEGRAL:
|
|
|
+ if ($this->user["usertype"] == 2) {
|
|
|
+ $user_id = $this->user["uid"];
|
|
|
+ $record = Db::table("new_integral_record")->findOrEmpty($mainId);
|
|
|
+ if ($user_id == $record["enterprise_id"])
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ break;
|
|
|
}
|
|
|
return false;
|
|
|
}
|