Zory 4 napja
szülő
commit
c62cb52479
2 módosított fájl, 26 hozzáadás és 2 törlés
  1. 13 2
      app/controller/admin/Order.php
  2. 13 0
      app/controller/api/Notify.php

+ 13 - 2
app/controller/admin/Order.php

@@ -4,6 +4,7 @@ namespace app\controller\admin;
 
 use app\extra\basic\Base;
 use app\middleware\AuthMiddleware;
+use app\service\saas\GoodsService;
 use app\service\saas\OrderService;
 use DI\Attribute\Inject;
 use LinFly\Annotation\Attributes\Route\Controller;
@@ -20,13 +21,23 @@ class Order extends Base
     #[Inject]
     protected OrderService $service;
 
+    #[Inject]
+    protected GoodsService $goodsService;
+
     #[GetMapping('list')]
     public function getOrderList(Request $request): Response
     {
         try {
             $param = $request->all();
-            $data = $this->service->setModel()->getList($param,['product' => function($query){
-                $query->field("product_id,product_name");
+            $productType = $this->goodsService->productType();
+            $data = $this->service->setModel()->getList($param,['product' => function($query) use($productType){
+                $query->field("product_id,product_name,product_type")->append(['types'])->withAttr(['types' => function($query,$resp) use($productType){
+                    $productTypeArr = [];
+                    foreach ($productType as $val) {
+                        $productTypeArr[$val['key']] = $val['name'];
+                    }
+                    return $productTypeArr[$resp['product_type']]??'';
+                }]);
             }]);
             return successTrans("success.data",pageFormat($data),200);
         } catch (\Throwable $throwable) {

+ 13 - 0
app/controller/api/Notify.php

@@ -40,6 +40,19 @@ class Notify extends Base
         }
     }
 
+    #[PostMapping("price")]
+    public function getOrderNotifyPrice(Request $request): Response
+    {
+        try {
+            $param = $request->all();
+            echo getDateFull()."===支付返回\n";
+            $data = !empty($param['msg']) ? json_decode($param['msg'],true) : [];
+            print_r($data);
+        } catch (\Throwable $throwable) {
+            return error($throwable->getMessage());
+        }
+    }
+
 
     #[PostMapping("mini")]
     public function getOrderNotifyMini(Request $request): Response