|
@@ -271,10 +271,27 @@ class TalentTypeChange extends AdminController {
|
|
|
$where[] = ["isConditionFile", "<>", 1];
|
|
|
$where[] = ["delete", "=", 0];
|
|
|
if ($condition && $condition["bindFileTypes"]) {
|
|
|
+ $companyWithFileType = array_filter(explode(";", $condition["companyWithFileType"]));
|
|
|
+ $cfKv = [];
|
|
|
+ for ($i = 0; $i < count($companyWithFileType); $i++) {
|
|
|
+ $setting = explode(":", $companyWithFileType[$i]);
|
|
|
+ $_companyId = $setting[0];
|
|
|
+ $_files = explode(",", $setting[1]);
|
|
|
+ $cfKv[$_companyId] = $_files;
|
|
|
+ }
|
|
|
$whr[] = ["id", "in", explode(",", $condition["bindFileTypes"])];
|
|
|
- $files = Db::table("new_common_filetype")->whereOr([$where, $whr])->order("sn asc")->select();
|
|
|
+ $files = Db::table("new_common_filetype")->whereOr([$where, $whr])->order("sn asc")->select()->toArray();
|
|
|
+ for ($i = 0; $i < count($files); $i++) {
|
|
|
+ foreach ($cfKv as $_companyId => $_files) {
|
|
|
+ if (in_array($files[$i]["id"], $_files)) {
|
|
|
+ $company = getCacheById("Company", $_companyId);
|
|
|
+ $files[$i]["name"] .= sprintf("<span style='color:red;'>(%s)</span>", $company["name"]);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
} else {
|
|
|
- $files = Db::table("new_common_filetype")->where($where)->order("sn asc")->select();
|
|
|
+ $files = Db::table("new_common_filetype")->where($where)->order("sn asc")->select()->toArray();
|
|
|
}
|
|
|
$response->code = 200;
|
|
|
$response->id = $id;
|
|
@@ -388,11 +405,38 @@ class TalentTypeChange extends AdminController {
|
|
|
}
|
|
|
$response->data = $info;
|
|
|
|
|
|
+ $condition = TalentConditionApi::getOne($info["newIdentifyCondition"]);
|
|
|
$whrFile = [];
|
|
|
- $whrFile[] = ["type", "=", $info["type"]];
|
|
|
+ $whrOr = [];
|
|
|
$whrFile[] = ["project", "=", ProjectState::LEVELCHANGE];
|
|
|
$whrFile[] = ["active", "=", 1];
|
|
|
- $response->fileList = \app\common\model\FileType::where($whrFile)->order("sn asc")->select()->toArray();
|
|
|
+ $whrFile[] = ["type", "=", $info["type"]];
|
|
|
+ $whrFile[] = ["isConditionFile", "<>", 1];
|
|
|
+ $whrFile[] = ["delete", "=", 0];
|
|
|
+ if ($condition && $condition["bindFileTypes"]) {
|
|
|
+ $companyWithFileType = array_filter(explode(";", $condition["companyWithFileType"]));
|
|
|
+ $cfKv = [];
|
|
|
+ for ($i = 0; $i < count($companyWithFileType); $i++) {
|
|
|
+ $setting = explode(":", $companyWithFileType[$i]);
|
|
|
+ $_companyId = $setting[0];
|
|
|
+ $_files = explode(",", $setting[1]);
|
|
|
+ $cfKv[$_companyId] = $_files;
|
|
|
+ }
|
|
|
+ $whrOr[] = ["id", "in", explode(",", $condition["bindFileTypes"])];
|
|
|
+ $files = \app\common\model\FileType::whereOr([$whrFile, $whrOr])->order("sn asc")->select()->toArray();
|
|
|
+ for ($i = 0; $i < count($files); $i++) {
|
|
|
+ foreach ($cfKv as $_companyId => $_files) {
|
|
|
+ if (in_array($files[$i]["id"], $_files)) {
|
|
|
+ $company = getCacheById("Company", $_companyId);
|
|
|
+ $files[$i]["name"] .= sprintf("<span style='color:red;'>(%s)</span>", $company["name"]);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $files = \app\common\model\FileType::where($whrFile)->order("sn asc")->select()->toArray();
|
|
|
+ }
|
|
|
+ $response->fileList = $files;
|
|
|
|
|
|
$fieldList = DictApi::getTalentTypeChangeFields($info["type"]);
|
|
|
$field_tmp = [];
|