Explorar o código

将路径反向

visuddhinanda@gmail.com %!s(int64=3) %!d(string=hai) anos
pai
achega
2fa68299d6
Modificáronse 1 ficheiros con 9 adicións e 2 borrados
  1. 9 2
      app/Console/Commands/UpgradePaliText.php

+ 9 - 2
app/Console/Commands/UpgradePaliText.php

@@ -42,7 +42,7 @@ class UpgradePaliText extends Command
     {
     {
 		$this->info("upgrade pali text");
 		$this->info("upgrade pali text");
 		$startTime = time();
 		$startTime = time();
-
+        
 		$_from = $this->argument('from');
 		$_from = $this->argument('from');
 		$_to = $this->argument('to');
 		$_to = $this->argument('to');
 		if(empty($_from) && empty($_to)){
 		if(empty($_from) && empty($_to)){
@@ -196,7 +196,14 @@ class UpgradePaliText extends Command
                         $currParent = $title_data[$currParent-1]["parent"];
                         $currParent = $title_data[$currParent-1]["parent"];
                         $iLoop++;
                         $iLoop++;
                     }
                     }
-                    $newData['path'] = $path;
+                    # 将路径反向
+                    $path1 = [];
+                    for ($i=count($path)-1; $i >=0 ; $i--) { 
+                        # code...
+                        $path1[] = $path[$i];
+                    }
+                    $newData['path'] = $path1;
+
 
 
 					PaliText::where('book',$book)
 					PaliText::where('book',$book)
 							->where('paragraph',$paragraph)
 							->where('paragraph',$paragraph)