|
|
@@ -6155,6 +6155,7 @@ class AnimeService
|
|
|
$cpid = Site::getCpid();
|
|
|
$product_name = trim(getProp($data, 'product_name'));
|
|
|
if (!$product_name) Utils::throwError('20003:名称不能为空');
|
|
|
+ $product_name = preg_replace('/^[\s*\[\]【】[]{}{}\x{3000}]+|[\s*\[\]【】[]{}{}\x{3000}]+$/u', '', $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) Utils::throwError('20003:名称不能重复,请修改');
|
|
|
$url = trim(getProp($data, 'url'));
|
|
|
@@ -6247,6 +6248,7 @@ class AnimeService
|
|
|
// 名称
|
|
|
$product_name = trim(getProp($data, 'product_name'));
|
|
|
if ($product_name) {
|
|
|
+ $product_name = preg_replace('/^[\s*\[\]【】[]{}{}\x{3000}]+|[\s*\[\]【】[]{}{}\x{3000}]+$/u', '', $product_name);
|
|
|
$updateData['product_name'] = $product_name;
|
|
|
}
|
|
|
|
|
|
@@ -7015,7 +7017,7 @@ class AnimeService
|
|
|
}
|
|
|
|
|
|
// 处理product_name两边的符号
|
|
|
- $product_name = preg_replace('/^[\s*()()\[\]【】[]{}{}\x{3000}]+|[\s*()()\[\]【】[]{}{}\x{3000}]+$/u', '', $product_name);
|
|
|
+ $product_name = preg_replace('/^[\s*\[\]【】[]{}{}\x{3000}]+|[\s*\[\]【】[]{}{}\x{3000}]+$/u', '', $product_name);
|
|
|
|
|
|
// 直接插入新资产到 mp_products 表(parent_id 指向对应类型的根文件夹)
|
|
|
$product_id = DB::table('mp_products')->insertGetId([
|