dever преди 4 години
родител
ревизия
dc771288c2
променени са 2 файла, в които са добавени 10 реда и са изтрити 1 реда
  1. 0 1
      app/collection/lib/Core.php
  2. 10 0
      app/collection/src/Api.php

+ 0 - 1
app/collection/lib/Core.php

@@ -170,7 +170,6 @@ class Core
         }
 
         $key = 'dlv1_' . $id. '_' . $parent_page_id . '_' . $page_id . '_' . $index . '_' . $times_id . '_' . $day . '_' . $uid . '_' . $ticket_id;
-
         $code = Dever::encode($key, $this->key);
 
         return $code;

+ 10 - 0
app/collection/src/Api.php

@@ -397,6 +397,16 @@ class Api extends Core
         return $data;
     }
 
+    # 根据page获取code
+    public function getCodeByPage()
+    {
+        $page_id = Dever::input('page_id');
+        $index = Dever::input('index', 0);
+        $data['code'] = $this->getCode($this->id, $this->parent_page_id, $page_id, $index, $this->times, $this->day, $this->share_uid, $this->ticket_id);
+
+        return $data;
+    }
+
     # 获取合集下的时光
     public function getTimes()
     {