Zory 2 månader sedan
förälder
incheckning
c5c8c4d14f

+ 1 - 0
app/controller/admin/Category.php

@@ -51,6 +51,7 @@ class Category extends Base
                 $factory = $this->model->where("id",$param['id'])->findOrEmpty();
                 if ($factory->isEmpty()) return errorTrans("error.data");
             }
+            $param['attribute'] = empty($param['attribute']) ? [] : json_encode($param['attribute']);
             $state = $this->model->setAutoData($param);
             if (!$state) return errorTrans("error.data");
             return successTrans("success.data");

+ 35 - 0
app/controller/api/School.php

@@ -0,0 +1,35 @@
+<?php
+
+namespace app\controller\api;
+
+use app\extra\basic\Base;
+use app\middleware\WxMiddleware;
+use LinFly\Annotation\Route\Controller;
+use LinFly\Annotation\Route\Middleware;
+use LinFly\Annotation\Route\Route;
+use support\Request;
+use support\Response;
+
+
+#[Controller(prefix: "/wx_api/school"),Middleware(WxMiddleware::class)]
+class School extends Base
+{
+
+    protected array $noNeedLogin = ['getPortalData'];
+
+    /**
+     * 商学院首页
+     * @param Request $request
+     * @return Response
+     */
+    #[Route(path: "portal",methods: "get")]
+    public function getPortalData(Request $request)
+    {
+        try {
+
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
+}

+ 12 - 5
app/controller/common/Common.php

@@ -4,8 +4,10 @@ namespace app\controller\common;
 
 use app\extra\basic\Base;
 use app\model\system\SystemConfig;
+use app\model\system\SystemData;
 use LinFly\Annotation\Route\Controller;
 use LinFly\Annotation\Route\Route;
+use support\Request;
 use support\Response;
 use Tinywan\Captcha\Captcha;
 
@@ -25,19 +27,24 @@ class Common extends Base
         try {
             $captcha = Captcha::base64();
             $service = (new SystemConfig)->where("type","service")->column("value","name");
+            $service['privacy'] = htmlspecialchars_decode(sConf("page.privacy"));
             return successTrans("success.data",compact('captcha','service'));
         } catch (\Throwable $throwable) {
             return error($throwable->getMessage());
         }
     }
 
-
-    #[Route(path: "test",methods: "get")]
-    public function testData()
+    #[Route(path: "dic",methods: "get")]
+    public function getDicData(Request $request): Response
     {
         try {
-            events("merge-pdf",['shop' => "326945519114632","order" => "202603263933413924333", "openid" => "otdgy3QxYqFjS_yl_YKUmLYMAtGI"]);
-            return success("ok");
+            $param = $this->_valid([
+                "type.require"  => trans("empty.require")
+            ],$request->all());
+            if (!is_array($param)) return error($param);
+            $data = (new SystemData)->where("code",$param['type'])->value("content");
+            $data = !empty($data) ? json_decode($data,true) : [];
+            return successTrans("success.data",$data);
         } catch (\Throwable $throwable) {
             return error($throwable->getMessage());
         }

+ 0 - 6
config/plugin/linfly/annotation/route.php

@@ -12,12 +12,6 @@ namespace LinFly\Annotation\Handle;
 
 use LinFly\Annotation\Bootstrap\AnnotationBootstrap;
 
-use Webman\Route;
-// 匹配所有options路由
-Route::options('[{path:.+}]', function (){
-    return response('',204);
-});
-
 if (!AnnotationBootstrap::isIgnoreProcess()) {
     RouteAnnotationHandle::createRoute();
 }

+ 0 - 0
webman