|
@@ -620,9 +620,9 @@ class Api extends BaseController {
|
|
|
case "application/zip":
|
|
|
case "application/x-rar-compressed":
|
|
|
case "application/x-7z-compressed":
|
|
|
- if(!in_array($file->extension(),['zip','7z','rar'])){
|
|
|
+ if (!in_array($file->extension(), ['zip', '7z', 'rar'])) {
|
|
|
$filestd = $upload->uploadOne($file, "file", "talent_files");
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
if (in_array($type, [ProjectState::JBT])) {
|
|
|
$filestd = $upload->uploadOne($file, "hybrid", "talent_files");
|
|
|
} else {
|
|
@@ -639,7 +639,7 @@ class Api extends BaseController {
|
|
|
exit();
|
|
|
break;
|
|
|
}
|
|
|
- if($filestd->code != 200){
|
|
|
+ if ($filestd->code != 200) {
|
|
|
$res = ["msg" => $filestd->msg, "obj" => $index];
|
|
|
echo sprintf("<script>parent.%s(%s);</script>", $backName, json_encode($res));
|
|
|
exit();
|
|
@@ -1241,9 +1241,39 @@ class Api extends BaseController {
|
|
|
}
|
|
|
|
|
|
public function findContractFileType() {
|
|
|
+ $talentId = $this->request["talentId"];
|
|
|
+ $talentInfo = \app\common\api\VerifyApi::getTalentInfoById($talentId);
|
|
|
+ $project = ProjectState::TALENT;
|
|
|
+ //检查是否有工作单位变更记录
|
|
|
+ $_where = [];
|
|
|
+ $_where[] = ["checkState", "=", 3];
|
|
|
+ $_where[] = ["delete", "=", 0];
|
|
|
+ $_where[] = ["idCard", "=", $talentInfo["card_number"]];
|
|
|
+ $workChange = Db::table("un_talent_workunit_change")->where($_where)->order("passTime desc")->find();
|
|
|
+
|
|
|
+ //检查是否有基础信息变更记录并且有合同变更
|
|
|
+ $_where = [];
|
|
|
+ $_where[] = ["checkState", "=", 3];
|
|
|
+ $_where[] = ["delete", "=", 0];
|
|
|
+ $_where[] = ["newIdCard", "=", $talentInfo["card_number"]];
|
|
|
+ $_string = "oldContractTime <> '' and oldContractTime <> concat(newContractStartTime,' - ',newContractEndTime)";
|
|
|
+ $baseChange = Db::table("un_talent_basic_change")->where($_where)->where($_string)->order("newSubmitTime desc")->find();
|
|
|
+
|
|
|
+ if ($workChange && !$baseChange) {
|
|
|
+ $project = ProjectState::WORKCHANGE;
|
|
|
+ }
|
|
|
+ if (!$workChange && $baseChange) {
|
|
|
+ $project = ProjectState::BASICCHANGE;
|
|
|
+ }
|
|
|
+ if ($workChange && $baseChange) {
|
|
|
+ $project = strtotime($workChange["passTime"]) > strtotime($baseChange["newSubmitTime"]) ? ProjectState::WORKCHANGE : ProjectState::BASICCHANGE;
|
|
|
+ }
|
|
|
+
|
|
|
$type = $this->request["type"];
|
|
|
- $where[] = ["name", "like", "%工作%"];
|
|
|
- $where[] = ["project", "=", 1];
|
|
|
+ if ($project == ProjectState::TALENT) {
|
|
|
+ $where[] = ["name", "like", "%工作%"];
|
|
|
+ }
|
|
|
+ $where[] = ["project", "=", $project];
|
|
|
$where[] = ["active", "=", 1];
|
|
|
$where[] = ["isConditionFile", "<>", 1];
|
|
|
$where[] = ["delete", "=", 0];
|
|
@@ -1260,7 +1290,7 @@ class Api extends BaseController {
|
|
|
return view("", ["id" => $talentInfo["id"], "type" => $type]);
|
|
|
}
|
|
|
|
|
|
- public function filePreview(){
|
|
|
+ public function filePreview() {
|
|
|
$url = $this->request["url"];
|
|
|
$title = $this->request["title"];
|
|
|
return view("", ["url" => $url, "title" => $title]);
|