shish 2 年 前
コミット
78898e35e6
1 ファイル変更18 行追加0 行削除
  1. 18 0
      console/controllers/ProductController.php

+ 18 - 0
console/controllers/ProductController.php

@@ -179,4 +179,22 @@ class ProductController extends Controller
         }
     }
 
+    //二个空间问题
+    public function actionEmpty()
+    {
+        ini_set('memory_limit', '5045M');
+        set_time_limit(0);
+        $list = PtItemClass::getAllByCondition(['delStatus' => 0], null, '*', null, true);
+        if (!empty($list)) {
+            foreach ($list as $item) {
+                $name = $item->name ?? '';
+                $name = trim($name);
+                $name = str_replace("   ", " ", $name);
+                $name = str_replace("  ", " ", $name);
+                $item->name = $name;
+                $item->save();
+            }
+        }
+    }
+
 }