Procházet zdrojové kódy

新增自定义字段接口

chenxiqiang před 6 roky
rodič
revize
64ea011f00

+ 10
- 0
manage-server/app/Http/Controllers/RewardController.php Zobrazit soubor

@@ -17,6 +17,16 @@ class RewardController extends Controller
17 17
         $this->price = $rewardPrice->price;
18 18
     }
19 19
 
20
+    public function getPrice(Request $request) {
21
+        $rewardPrice = RewardPrice::find(1);
22
+        return response()->json([
23
+            "status" => 0,
24
+            "data" => [
25
+                "price" => $rewardPrice->price
26
+            ]
27
+        ]);
28
+    }
29
+
20 30
     public function price(Request $request) {
21 31
         $price = $request->input("price");
22 32
         if($price) {

+ 1
- 0
manage-server/routes/web.php Zobrazit soubor

@@ -70,5 +70,6 @@ Route::middleware(['manage.token'])->group(function () {
70 70
 
71 71
 
72 72
     Route::post('/reward/price', 'RewardController@price');
73
+    Route::get('/reward/price', 'RewardController@getPrice');
73 74
 
74 75
 });

Loading…
Zrušit
Uložit