Procházet zdrojové kódy

修复资产库重名限制问题

lh před 1 týdnem
rodič
revize
4d5b08dd16
1 změnil soubory, kde provedl 4 přidání a 4 odebrání
  1. 4 4
      app/Services/Anime/AnimeService.php

+ 4 - 4
app/Services/Anime/AnimeService.php

@@ -5882,8 +5882,8 @@ class AnimeService
         $cpid = Site::getCpid();
         $product_name = trim(getProp($data, 'product_name'));
         if (!$product_name) Utils::throwError('20003:名称不能为空');
-        $exists_id = DB::table('mp_products')->where('cpid', $cpid)->where('type', 1)->where('product_name', $product_name)->where('is_deleted', 0)->value('id');
-        if ($exists_id) Utils::throwError('20003:名称不能重复,请修改');
+        // $exists_id = DB::table('mp_products')->where('cpid', $cpid)->where('type', 1)->where('product_name', $product_name)->where('is_deleted', 0)->value('id');
+        // if ($exists_id) Utils::throwError('20003:名称不能重复,请修改');
         $url = trim(getProp($data, 'url'));
         if (!$url) Utils::throwError('20003:图片地址不能为空');
         $versions = getProp($data, 'versions');
@@ -5977,8 +5977,8 @@ class AnimeService
             $updateData['product_name'] = $product_name;
         }
 
-        $exists_id = DB::table('mp_products')->where('cpid', $cpid)->where('type', 1)->where('product_name', $product_name)->where('is_deleted', 0)->value('id');
-        if ($exists_id && $exists_id != $id) Utils::throwError('20003:名称不能重复,请修改');
+        // $exists_id = DB::table('mp_products')->where('cpid', $cpid)->where('type', 1)->where('product_name', $product_name)->where('is_deleted', 0)->value('id');
+        // if ($exists_id && $exists_id != $id) Utils::throwError('20003:名称不能重复,请修改');
         
         // 图片地址
         $url = trim(getProp($data, 'url'));