فهرست منبع

获取订单金额

15313670163 4 ماه پیش
والد
کامیت
5b46b56868
5فایلهای تغییر یافته به همراه267 افزوده شده و 5 حذف شده
  1. 29 2
      app/Controller/OrderController.php
  2. 8 0
      app/JsonRpc/OrderService.php
  3. 4 1
      app/JsonRpc/OrderServiceInterface.php
  4. 224 2
      composer.lock
  5. 2 0
      config/api/order.php

+ 29 - 2
app/Controller/OrderController.php

@@ -161,7 +161,33 @@ class OrderController extends AbstractController
         $result = $this->orderServiceClient->getOrderListAdmin($requireData);
         return $result['code'] == 200 ? Result::success($result['data']) : Result::error($result['message']);
     }
-
+     /**
+     * 根据网站查找广告位
+     */
+    public function getPrice(){
+        $requireData = $this->request->all();
+        $validator = $this->validationFactory->make(
+        $requireData,
+            [
+                'starttime' => 'required',
+                'endtime' => 'required',
+            ],
+            [
+                'starttime.required' => '广告开始时间不能为空',
+                'endtime.required' => '广告结束时间不能为空',
+            ]
+        );
+        if ($validator->fails()) {
+            $errorMessage = $validator->errors()->first();
+            return Result::error($errorMessage);
+        }
+        $commaSeparatedString = $requireData['pid'];
+        $array = explode(",", $commaSeparatedString);
+        $requireData['pid'] = $array;
+        // var_dump($requireData);
+        $result = $this->orderServiceClient->getPrice($requireData);
+        return $result['code'] == 200 ? Result::success($result['data']) : Result::error($result['message']);
+    }
     /**
      * 添加订单
      */
@@ -179,6 +205,7 @@ class OrderController extends AbstractController
                 'imgurl' => 'required',
                 'imgsrc' => 'required',
                 'pid' => 'required',
+                'price' =>'required'
             ],
             [
                 'name.required' => '广告名称不能为空',
@@ -188,7 +215,7 @@ class OrderController extends AbstractController
                 'imgurl.required' => '图片广告链接不能为空',
                 'imgsrc.required' => '图片广告地址不能为空',
                 'pid.required' => '广告位id不能为空',
-
+                'price.required' => '价格不能为空'
             ]
         );
 

+ 8 - 0
app/JsonRpc/OrderService.php

@@ -62,6 +62,14 @@ class OrderService extends AbstractServiceClient implements OrderServiceInterfac
         return $this->__request(__FUNCTION__, $data);
     }
     public function delOrderAdmin(array $data)
+    {
+        return $this->__request(__FUNCTION__, $data);
+    }
+     /**
+     * @param array $data
+     * @return mixed
+     */
+    public function getPrice(array $data)
     {
         return $this->__request(__FUNCTION__, $data);
     }

+ 4 - 1
app/JsonRpc/OrderServiceInterface.php

@@ -41,7 +41,10 @@ interface OrderServiceInterface
      * @param array $data
      */
     public function delOrderAdmin(array $data);
-    
+      /**
+     * @param array $data
+     */
+    public function getPrice(array $data);
     /**
      * @param array $data
      */

+ 224 - 2
composer.lock

@@ -718,6 +718,7 @@
             "time": "2020-11-24T22:02:12+00:00"
         },
         {
+<<<<<<< HEAD
             "name": "friendsofhyperf/openai-client",
             "version": "v3.1.48",
             "source": {
@@ -797,6 +798,17 @@
             },
             "dist": {
                 "type": "zip",
+=======
+            "name": "graham-campbell/result-type",
+            "version": "v1.1.3",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/GrahamCampbell/Result-Type.git",
+                "reference": "3ba905c11371512af9d9bdd27d99b782216b6945"
+            },
+            "dist": {
+                "type": "zip",
+>>>>>>> 20241029_fl_order
                 "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/3ba905c11371512af9d9bdd27d99b782216b6945",
                 "reference": "3ba905c11371512af9d9bdd27d99b782216b6945",
                 "shasum": ""
@@ -1251,6 +1263,7 @@
             "time": "2024-09-25T02:54:12+00:00"
         },
         {
+<<<<<<< HEAD
             "name": "hyperf/async-queue",
             "version": "v3.1.42",
             "source": {
@@ -1337,6 +1350,17 @@
             },
             "dist": {
                 "type": "zip",
+=======
+            "name": "hyperf/cache",
+            "version": "v3.1.43",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/hyperf/cache.git",
+                "reference": "1e3cc54cee776c8d32cf40912dee5d366383bc33"
+            },
+            "dist": {
+                "type": "zip",
+>>>>>>> 20241029_fl_order
                 "url": "https://api.github.com/repos/hyperf/cache/zipball/1e3cc54cee776c8d32cf40912dee5d366383bc33",
                 "reference": "1e3cc54cee776c8d32cf40912dee5d366383bc33",
                 "shasum": ""
@@ -2251,6 +2275,7 @@
         },
         {
             "name": "hyperf/coroutine",
+<<<<<<< HEAD
             "version": "v3.1.42",
             "source": {
                 "type": "git",
@@ -2261,6 +2286,18 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/hyperf/coroutine/zipball/1dd56202a97bce60df644ea1a8c87ea7a0888a08",
                 "reference": "1dd56202a97bce60df644ea1a8c87ea7a0888a08",
+=======
+            "version": "v3.1.49",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/hyperf/coroutine.git",
+                "reference": "959ea68ac700061d8f7b76708bc52f588b66979b"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/hyperf/coroutine/zipball/959ea68ac700061d8f7b76708bc52f588b66979b",
+                "reference": "959ea68ac700061d8f7b76708bc52f588b66979b",
+>>>>>>> 20241029_fl_order
                 "shasum": ""
             },
             "require": {
@@ -2311,6 +2348,7 @@
                     "type": "open_collective"
                 }
             ],
+<<<<<<< HEAD
             "time": "2024-09-25T02:54:12+00:00"
         },
         {
@@ -2325,6 +2363,22 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/hyperf/database/zipball/a53d2616486e0a77923542bb5cc363e207e5003d",
                 "reference": "a53d2616486e0a77923542bb5cc363e207e5003d",
+=======
+            "time": "2024-12-13T07:51:52+00:00"
+        },
+        {
+            "name": "hyperf/database",
+            "version": "v3.1.48",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/hyperf/database.git",
+                "reference": "a16b070ee2ac2ec580a4c6f5bb6243350bed69e6"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/hyperf/database/zipball/a16b070ee2ac2ec580a4c6f5bb6243350bed69e6",
+                "reference": "a16b070ee2ac2ec580a4c6f5bb6243350bed69e6",
+>>>>>>> 20241029_fl_order
                 "shasum": ""
             },
             "require": {
@@ -2384,7 +2438,11 @@
                     "type": "open_collective"
                 }
             ],
+<<<<<<< HEAD
             "time": "2024-11-28T01:51:55+00:00"
+=======
+            "time": "2024-12-12T01:58:16+00:00"
+>>>>>>> 20241029_fl_order
         },
         {
             "name": "hyperf/db-connection",
@@ -2600,6 +2658,7 @@
         },
         {
             "name": "hyperf/engine",
+<<<<<<< HEAD
             "version": "v2.12.0",
             "source": {
                 "type": "git",
@@ -2610,6 +2669,18 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/hyperf/engine/zipball/f04115044ba0f483889b5849c5bc8045d3ab5b8a",
                 "reference": "f04115044ba0f483889b5849c5bc8045d3ab5b8a",
+=======
+            "version": "v2.12.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/hyperf/engine.git",
+                "reference": "90be8143841482dcd00051050986251e126c6132"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/hyperf/engine/zipball/90be8143841482dcd00051050986251e126c6132",
+                "reference": "90be8143841482dcd00051050986251e126c6132",
+>>>>>>> 20241029_fl_order
                 "shasum": ""
             },
             "require": {
@@ -2636,11 +2707,17 @@
             },
             "type": "library",
             "extra": {
+<<<<<<< HEAD
                 "branch-alias": {
                     "dev-master": "2.12-dev"
                 },
+=======
+>>>>>>> 20241029_fl_order
                 "hyperf": {
                     "config": "Hyperf\\Engine\\ConfigProvider"
+                },
+                "branch-alias": {
+                    "dev-master": "2.12-dev"
                 }
             },
             "autoload": {
@@ -2664,7 +2741,11 @@
             ],
             "support": {
                 "issues": "https://github.com/hyperf/engine/issues",
+<<<<<<< HEAD
                 "source": "https://github.com/hyperf/engine/tree/v2.12.0"
+=======
+                "source": "https://github.com/hyperf/engine/tree/v2.12.1"
+>>>>>>> 20241029_fl_order
             },
             "funding": [
                 {
@@ -2676,7 +2757,11 @@
                     "type": "open_collective"
                 }
             ],
+<<<<<<< HEAD
             "time": "2024-11-19T04:32:29+00:00"
+=======
+            "time": "2024-12-17T12:36:21+00:00"
+>>>>>>> 20241029_fl_order
         },
         {
             "name": "hyperf/engine-contract",
@@ -3031,6 +3116,7 @@
         },
         {
             "name": "hyperf/http-message",
+<<<<<<< HEAD
             "version": "v3.1.47",
             "source": {
                 "type": "git",
@@ -3041,6 +3127,18 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/hyperf/http-message/zipball/53a7caa616ee7a196d2974348b1acbf75305bf7e",
                 "reference": "53a7caa616ee7a196d2974348b1acbf75305bf7e",
+=======
+            "version": "v3.1.48",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/hyperf/http-message.git",
+                "reference": "534ce81af0feaa0c4a9e132af1c6a9c5527a8d85"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/hyperf/http-message/zipball/534ce81af0feaa0c4a9e132af1c6a9c5527a8d85",
+                "reference": "534ce81af0feaa0c4a9e132af1c6a9c5527a8d85",
+>>>>>>> 20241029_fl_order
                 "shasum": ""
             },
             "require": {
@@ -3082,7 +3180,11 @@
             ],
             "support": {
                 "issues": "https://github.com/hyperf/http-message/issues",
+<<<<<<< HEAD
                 "source": "https://github.com/hyperf/http-message/tree/v3.1.47"
+=======
+                "source": "https://github.com/hyperf/http-message/tree/v3.1.48"
+>>>>>>> 20241029_fl_order
             },
             "funding": [
                 {
@@ -3094,7 +3196,11 @@
                     "type": "open_collective"
                 }
             ],
+<<<<<<< HEAD
             "time": "2024-11-28T02:09:19+00:00"
+=======
+            "time": "2024-12-05T02:41:08+00:00"
+>>>>>>> 20241029_fl_order
         },
         {
             "name": "hyperf/http-server",
@@ -3640,6 +3746,7 @@
             "time": "2024-09-25T02:54:12+00:00"
         },
         {
+<<<<<<< HEAD
             "name": "hyperf/paginator",
             "version": "v3.1.42",
             "source": {
@@ -3717,6 +3824,17 @@
             },
             "dist": {
                 "type": "zip",
+=======
+            "name": "hyperf/pipeline",
+            "version": "v3.1.42",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/hyperf/pipeline.git",
+                "reference": "096d9a9f87ddea33209f134d30ae8d8867a195c7"
+            },
+            "dist": {
+                "type": "zip",
+>>>>>>> 20241029_fl_order
                 "url": "https://api.github.com/repos/hyperf/pipeline/zipball/096d9a9f87ddea33209f134d30ae8d8867a195c7",
                 "reference": "096d9a9f87ddea33209f134d30ae8d8867a195c7",
                 "shasum": ""
@@ -3836,6 +3954,7 @@
         },
         {
             "name": "hyperf/process",
+<<<<<<< HEAD
             "version": "v3.1.42",
             "source": {
                 "type": "git",
@@ -3846,6 +3965,18 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/hyperf/process/zipball/2b2286cff615989f01cb87691882b61c4c931ea3",
                 "reference": "2b2286cff615989f01cb87691882b61c4c931ea3",
+=======
+            "version": "v3.1.48",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/hyperf/process.git",
+                "reference": "8d68398bdb4f2623af1bec846399b6ce29bd7d2c"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/hyperf/process/zipball/8d68398bdb4f2623af1bec846399b6ce29bd7d2c",
+                "reference": "8d68398bdb4f2623af1bec846399b6ce29bd7d2c",
+>>>>>>> 20241029_fl_order
                 "shasum": ""
             },
             "require": {
@@ -3902,7 +4033,11 @@
                     "type": "open_collective"
                 }
             ],
+<<<<<<< HEAD
             "time": "2024-09-25T02:54:12+00:00"
+=======
+            "time": "2024-12-02T10:54:30+00:00"
+>>>>>>> 20241029_fl_order
         },
         {
             "name": "hyperf/redis",
@@ -5818,6 +5953,7 @@
                 "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.4"
             },
             "time": "2024-09-29T15:01:53+00:00"
+<<<<<<< HEAD
         },
         {
             "name": "openai-php/client",
@@ -5909,6 +6045,8 @@
                 }
             ],
             "time": "2024-11-12T20:51:16+00:00"
+=======
+>>>>>>> 20241029_fl_order
         },
         {
             "name": "paragonie/constant_time_encoding",
@@ -6425,6 +6563,7 @@
         },
         {
             "name": "phpseclib/phpseclib",
+<<<<<<< HEAD
             "version": "3.0.42",
             "source": {
                 "type": "git",
@@ -6435,6 +6574,18 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/db92f1b1987b12b13f248fe76c3a52cadb67bb98",
                 "reference": "db92f1b1987b12b13f248fe76c3a52cadb67bb98",
+=======
+            "version": "3.0.43",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/phpseclib/phpseclib.git",
+                "reference": "709ec107af3cb2f385b9617be72af8cf62441d02"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/709ec107af3cb2f385b9617be72af8cf62441d02",
+                "reference": "709ec107af3cb2f385b9617be72af8cf62441d02",
+>>>>>>> 20241029_fl_order
                 "shasum": ""
             },
             "require": {
@@ -6515,7 +6666,11 @@
             ],
             "support": {
                 "issues": "https://github.com/phpseclib/phpseclib/issues",
+<<<<<<< HEAD
                 "source": "https://github.com/phpseclib/phpseclib/tree/3.0.42"
+=======
+                "source": "https://github.com/phpseclib/phpseclib/tree/3.0.43"
+>>>>>>> 20241029_fl_order
             },
             "funding": [
                 {
@@ -6531,7 +6686,11 @@
                     "type": "tidelift"
                 }
             ],
+<<<<<<< HEAD
             "time": "2024-09-16T03:06:04+00:00"
+=======
+            "time": "2024-12-14T21:12:59+00:00"
+>>>>>>> 20241029_fl_order
         },
         {
             "name": "psr/cache",
@@ -9004,6 +9163,7 @@
         },
         {
             "name": "hyperf/testing",
+<<<<<<< HEAD
             "version": "v3.1.46",
             "source": {
                 "type": "git",
@@ -9014,6 +9174,18 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/hyperf/testing/zipball/d703d287817c577acfee0cec108dc2f4217ac9fa",
                 "reference": "d703d287817c577acfee0cec108dc2f4217ac9fa",
+=======
+            "version": "v3.1.48",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/hyperf/testing.git",
+                "reference": "e5e5eba5c304a876dd251e774ecdb3a8ebf97edd"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/hyperf/testing/zipball/e5e5eba5c304a876dd251e774ecdb3a8ebf97edd",
+                "reference": "e5e5eba5c304a876dd251e774ecdb3a8ebf97edd",
+>>>>>>> 20241029_fl_order
                 "shasum": ""
             },
             "require": {
@@ -9059,7 +9231,11 @@
                 "testing"
             ],
             "support": {
+<<<<<<< HEAD
                 "source": "https://github.com/hyperf/testing/tree/v3.1.46"
+=======
+                "source": "https://github.com/hyperf/testing/tree/v3.1.48"
+>>>>>>> 20241029_fl_order
             },
             "funding": [
                 {
@@ -9071,7 +9247,11 @@
                     "type": "open_collective"
                 }
             ],
+<<<<<<< HEAD
             "time": "2024-11-20T07:42:54+00:00"
+=======
+            "time": "2024-12-12T02:12:29+00:00"
+>>>>>>> 20241029_fl_order
         },
         {
             "name": "hyperf/watcher",
@@ -9402,6 +9582,7 @@
         },
         {
             "name": "phpstan/phpstan",
+<<<<<<< HEAD
             "version": "1.12.12",
             "source": {
                 "type": "git",
@@ -9412,6 +9593,18 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b5ae1b88f471d3fd4ba1aa0046234b5ca3776dd0",
                 "reference": "b5ae1b88f471d3fd4ba1aa0046234b5ca3776dd0",
+=======
+            "version": "1.12.13",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/phpstan/phpstan.git",
+                "reference": "9b469068840cfa031e1deaf2fa1886d00e20680f"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9b469068840cfa031e1deaf2fa1886d00e20680f",
+                "reference": "9b469068840cfa031e1deaf2fa1886d00e20680f",
+>>>>>>> 20241029_fl_order
                 "shasum": ""
             },
             "require": {
@@ -9456,7 +9649,11 @@
                     "type": "github"
                 }
             ],
+<<<<<<< HEAD
             "time": "2024-11-28T22:13:23+00:00"
+=======
+            "time": "2024-12-17T17:00:20+00:00"
+>>>>>>> 20241029_fl_order
         },
         {
             "name": "phpunit/php-code-coverage",
@@ -9781,6 +9978,7 @@
         },
         {
             "name": "phpunit/phpunit",
+<<<<<<< HEAD
             "version": "10.5.38",
             "source": {
                 "type": "git",
@@ -9791,6 +9989,18 @@
                 "type": "zip",
                 "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a86773b9e887a67bc53efa9da9ad6e3f2498c132",
                 "reference": "a86773b9e887a67bc53efa9da9ad6e3f2498c132",
+=======
+            "version": "10.5.39",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/sebastianbergmann/phpunit.git",
+                "reference": "4e89eff200b801db58f3d580ad7426431949eaa9"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4e89eff200b801db58f3d580ad7426431949eaa9",
+                "reference": "4e89eff200b801db58f3d580ad7426431949eaa9",
+>>>>>>> 20241029_fl_order
                 "shasum": ""
             },
             "require": {
@@ -9800,7 +10010,11 @@
                 "ext-mbstring": "*",
                 "ext-xml": "*",
                 "ext-xmlwriter": "*",
+<<<<<<< HEAD
                 "myclabs/deep-copy": "^1.12.0",
+=======
+                "myclabs/deep-copy": "^1.12.1",
+>>>>>>> 20241029_fl_order
                 "phar-io/manifest": "^2.0.4",
                 "phar-io/version": "^3.2.1",
                 "php": ">=8.1",
@@ -9862,7 +10076,11 @@
             "support": {
                 "issues": "https://github.com/sebastianbergmann/phpunit/issues",
                 "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
+<<<<<<< HEAD
                 "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.38"
+=======
+                "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.39"
+>>>>>>> 20241029_fl_order
             },
             "funding": [
                 {
@@ -9878,7 +10096,11 @@
                     "type": "tidelift"
                 }
             ],
+<<<<<<< HEAD
             "time": "2024-10-28T13:06:21+00:00"
+=======
+            "time": "2024-12-11T10:51:07+00:00"
+>>>>>>> 20241029_fl_order
         },
         {
             "name": "react/cache",
@@ -12082,12 +12304,12 @@
     ],
     "aliases": [],
     "minimum-stability": "dev",
-    "stability-flags": [],
+    "stability-flags": {},
     "prefer-stable": true,
     "prefer-lowest": false,
     "platform": {
         "php": ">=8.1"
     },
-    "platform-dev": [],
+    "platform-dev": {},
     "plugin-api-version": "2.6.0"
 }

+ 2 - 0
config/api/order.php

@@ -14,6 +14,8 @@ Router::addGroup(
         Router::post('/getAD', [OrderController::class, 'getAD']);
         //根据网站搜索广告
         Router::post('/getWebsiteAd', [OrderController::class, 'getWebsiteAd']);
+        //获取订单金额
+        Router::get('/getPrice', [OrderController::class, 'getPrice']);
         //添加订单
         Router::post('/addAD', [OrderController::class, 'addAD']);