|
@@ -336,36 +336,65 @@ class Api extends BaseController {
|
|
case 20:
|
|
case 20:
|
|
//积分申报的附件需要特殊处理
|
|
//积分申报的附件需要特殊处理
|
|
$newList = [];
|
|
$newList = [];
|
|
|
|
+
|
|
|
|
+ $_where = $where;
|
|
|
|
+ $_where[] = ["isConditionFile", "=", 1];
|
|
|
|
+ $fileTypes = Db::table("new_common_filetype")->where($_where)->order("must asc")->order("sn " . $order)->select()->toArray();
|
|
|
|
+ foreach ($fileTypes as $k => $ft) {
|
|
|
|
+ $_whr = [];
|
|
|
|
+ if ($id) {
|
|
|
|
+ $_whr[] = ["mainId", "=", $id];
|
|
|
|
+ } else {
|
|
|
|
+ $_whr[] = ["description", "=", $token];
|
|
|
|
+ }
|
|
|
|
+ $_whr[] = ["relationId", "=", 0];
|
|
|
|
+ $_whr[] = ["typeId", "=", $ft["id"]];
|
|
|
|
+ $files = Db::table("new_talent_file")->where($_whr)->field("id,typeId,orignName,url,relationId")->order("sn asc")->select()->toArray();
|
|
|
|
+ foreach ($files as $n => $file) {
|
|
|
|
+ $files[$n]["ext"] = pathinfo($file["url"])["extension"];
|
|
|
|
+ $files[$n]["url"] = getStoragePath($file["url"]);
|
|
|
|
+ }
|
|
|
|
+ $fileTypes[$k]["files"] = $files;
|
|
|
|
+ }
|
|
|
|
+ $newList[] = [
|
|
|
|
+ "id" => 0,
|
|
|
|
+ "name" => "公共附件",
|
|
|
|
+ "fileTypes" => $fileTypes
|
|
|
|
+ ];
|
|
|
|
+
|
|
$itemIds = $param["itemId"];
|
|
$itemIds = $param["itemId"];
|
|
$redis = \app\common\Redis::instance(\think\facade\Config::get("cache.stores.redis.select"));
|
|
$redis = \app\common\Redis::instance(\think\facade\Config::get("cache.stores.redis.select"));
|
|
- foreach ($itemIds as $key => $item_id) {
|
|
|
|
- $integral_item = json_decode($redis->hGet("IntegralItem", $item_id), true);
|
|
|
|
- if ($integral_item["fileTypeId"]) {
|
|
|
|
- $typeIds = array_filter(explode(",", $integral_item["fileTypeId"]));
|
|
|
|
- $whr = $where;
|
|
|
|
- $whr[] = ["id", "in", $typeIds];
|
|
|
|
- $fileTypes = Db::table("new_common_filetype")->where($whr)->order("must asc")->order("sn " . $order)->select()->toArray();
|
|
|
|
- foreach ($fileTypes as $k => $ft) {
|
|
|
|
- $_whr = [];
|
|
|
|
- if ($id) {
|
|
|
|
- $_whr[] = ["mainId", "=", $id];
|
|
|
|
- } else {
|
|
|
|
- $_whr[] = ["description", "=", $token];
|
|
|
|
- }
|
|
|
|
- $_whr[] = ["relationId", "=", $item_id];
|
|
|
|
- $_whr[] = ["typeId", "=", $ft["id"]];
|
|
|
|
- $files = Db::table("new_talent_file")->where($_whr)->field("id,typeId,orignName,url,relationId")->order("sn asc")->select()->toArray();
|
|
|
|
- foreach ($files as $n => $file) {
|
|
|
|
- $files[$n]["ext"] = pathinfo($file["url"])["extension"];
|
|
|
|
- $files[$n]["url"] = getStoragePath($file["url"]);
|
|
|
|
|
|
+ if ($itemIds) {
|
|
|
|
+ foreach ($itemIds as $key => $item_id) {
|
|
|
|
+ $integral_item = json_decode($redis->hGet("IntegralItem", $item_id), true);
|
|
|
|
+ if ($integral_item["fileTypeId"]) {
|
|
|
|
+ $typeIds = array_filter(explode(",", $integral_item["fileTypeId"]));
|
|
|
|
+ $whr = $where;
|
|
|
|
+ $whr[] = ["id", "in", $typeIds];
|
|
|
|
+ $whr[] = ["isConditionFile", "=", 0];
|
|
|
|
+ $fileTypes = Db::table("new_common_filetype")->where($whr)->order("must asc")->order("sn " . $order)->select()->toArray();
|
|
|
|
+ foreach ($fileTypes as $k => $ft) {
|
|
|
|
+ $_whr = [];
|
|
|
|
+ if ($id) {
|
|
|
|
+ $_whr[] = ["mainId", "=", $id];
|
|
|
|
+ } else {
|
|
|
|
+ $_whr[] = ["description", "=", $token];
|
|
|
|
+ }
|
|
|
|
+ $_whr[] = ["relationId", "=", $item_id];
|
|
|
|
+ $_whr[] = ["typeId", "=", $ft["id"]];
|
|
|
|
+ $files = Db::table("new_talent_file")->where($_whr)->field("id,typeId,orignName,url,relationId")->order("sn asc")->select()->toArray();
|
|
|
|
+ foreach ($files as $n => $file) {
|
|
|
|
+ $files[$n]["ext"] = pathinfo($file["url"])["extension"];
|
|
|
|
+ $files[$n]["url"] = getStoragePath($file["url"]);
|
|
|
|
+ }
|
|
|
|
+ $fileTypes[$k]["files"] = $files;
|
|
}
|
|
}
|
|
- $fileTypes[$k]["files"] = $files;
|
|
|
|
|
|
+ $newList[] = [
|
|
|
|
+ "id" => $integral_item["id"],
|
|
|
|
+ "name" => $integral_item["name"],
|
|
|
|
+ "fileTypes" => $fileTypes
|
|
|
|
+ ];
|
|
}
|
|
}
|
|
- $newList[] = [
|
|
|
|
- "id" => $integral_item["id"],
|
|
|
|
- "name" => $integral_item["name"],
|
|
|
|
- "fileTypes" => $fileTypes
|
|
|
|
- ];
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return json(["rows" => $newList]);
|
|
return json(["rows" => $newList]);
|