dever %!s(int64=6) %!d(string=hai) anos
pai
achega
8021248210
Modificáronse 1 ficheiros con 19 adicións e 1 borrados
  1. 19 1
      src/Code.php

+ 19 - 1
src/Code.php

@@ -11,7 +11,7 @@ use Token\Lib\Wechat;
 
 class Code
 {
-    public function get()
+    public function get($send = array())
     {
         $project = Dever::input('project');
         $param['path'] = Dever::input('path', 'pages/index/index');
@@ -19,6 +19,24 @@ class Code
         $param['width'] = Dever::input('width', 200);
         $update = Dever::input('update', 2);
 
+        if ($send) {
+            if (isset($send['project'])) {
+                $project = $send['project'];
+            }
+            if (isset($send['path'])) {
+                $param['path'] = $send['path'];
+            }
+            if (isset($send['send'])) {
+                $param['send'] = $send['send'];
+            }
+            if (isset($send['width'])) {
+                $param['width'] = $send['width'];
+            }
+            if (isset($send['update'])) {
+                $update = $send['update'];
+            }
+        }
+
         $file = Dever::pathDay('upload/applet/code', false) . $project . '_' . md5($param['path'] . '_' . $param['param'] . '_' . $param['width']) . '.jpg';
 
         if (!is_file($file) || $update == 1) {