sugangqiang 1 éve
szülő
commit
3120476e99
1 módosított fájl, 17 hozzáadás és 1 törlés
  1. 17 1
      app/common/controller/Api.php

+ 17 - 1
app/common/controller/Api.php

@@ -459,7 +459,18 @@ class Api extends BaseController {
                 $rows[$key]["files"] = $files;
             }
         }
-        return json(["rows" => $rows]);
+        $old_types = [];
+        if ($project == ProjectState::LEVELCHANGE) {
+            $where = [];
+            $where[] = ["type", "=", $type];
+            $where[] = ["project", "=", $project];
+            $where[] = ["active", "=", 1];
+            $old_types = Db::table("un_common_filetype")->where($where)->order("must")->order("sn")->select()->toArray();
+        }
+        if ($old_types) {
+            $rows = array_merge($rows, $old_types);
+        }
+        return json(["rows" => $rows, "old_types" => $old_types]);
     }
 
     public function listTalentFile() {
@@ -468,6 +479,11 @@ class Api extends BaseController {
         $typeId = $param["fileTypeId"];
         $where = [["mainId", "=", $mainId], ["typeId", "=", $typeId]];
         $list = Db::table("new_talent_file")->where($where)->select()->toArray();
+        $_where = [["mainId", "=", $mainId], ["fileTypeId", "=", $typeId]];
+        $old_list = Db::table("un_talent_file")->where($_where)->select()->toArray();
+        if ($old_list) {
+            $list = array_merge($list, $old_list);
+        }
         foreach ($list as $key => $item) {
             $list[$key]["ext"] = pathinfo($item["url"])["extension"];
             $list[$key]["url"] = getStoragePath($item["url"]);