|
@@ -61,12 +61,18 @@ class TalentWorkUnitChange extends EnterpriseController {
|
|
|
public function apply() {
|
|
|
$request = $this->request;
|
|
|
$id = isset($request["id"]) ? $request["id"] : 0;
|
|
|
+ $talentId = isset($request["talentId"]) ? $request["talentId"] : 0;
|
|
|
$info = TwcModel::where("id", $id)->find();
|
|
|
if ($info) {
|
|
|
$epOld = EnterpriseApi::getOne($info["oldEnterpriseId"]);
|
|
|
$epNew = EnterpriseApi::getOne($info["newEnterpriseId"]);
|
|
|
$info["oldEnterpriseName"] = $epOld["name"];
|
|
|
$info["newEnterpriseName"] = $epNew["name"];
|
|
|
+ if (strlen($info["talentId"]) == 19) {
|
|
|
+ $newTalentInfo = $this->getTalentInfoByIdCard($info["idCard"]);
|
|
|
+ $info["talentId"] = $newTalentInfo["id"];
|
|
|
+ }
|
|
|
+ $talentId = $info["talentId"];
|
|
|
}
|
|
|
if ($this->request->isPost()) {
|
|
|
$response = new \stdClass();
|
|
@@ -76,11 +82,7 @@ class TalentWorkUnitChange extends EnterpriseController {
|
|
|
if ($check->code == 500) {
|
|
|
return $check;
|
|
|
}
|
|
|
- if (strlen($info["talentId"]) == 19) {
|
|
|
- $newTalentInfo = $this->getTalentInfoByIdCard($info["idCard"]);
|
|
|
- $info["talentId"] = $newTalentInfo["id"];
|
|
|
- }
|
|
|
- $talentInfo = \app\common\api\VerifyApi::getTalentInfoById($info["talentId"]);
|
|
|
+ $talentInfo = \app\common\api\VerifyApi::getTalentInfoById($talentId);
|
|
|
if (!$talentInfo) {
|
|
|
$response->msg = "未匹配到人才数据";
|
|
|
return $response;
|
|
@@ -152,8 +154,8 @@ class TalentWorkUnitChange extends EnterpriseController {
|
|
|
$where[] = ["project", "=", ProjectState::WORKCHANGE];
|
|
|
$where[] = ["active", "=", 1];
|
|
|
$filetypes = Db::table("new_common_filetype")->where($where)->order("sn asc")->select()->toArray();
|
|
|
+ $sb = [];
|
|
|
foreach ($filetypes as $filetype) {
|
|
|
- $sb = [];
|
|
|
$sb[] = "以下为必传附件:";
|
|
|
if ($filetype["must"] == 1) {
|
|
|
$where = [];
|