Selaa lähdekoodia

新增自定义字段接口

chenxiqiang 6 vuotta sitten
vanhempi
commit
64ea011f00

+ 10
- 0
manage-server/app/Http/Controllers/RewardController.php Näytä tiedosto

17
         $this->price = $rewardPrice->price;
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
     public function price(Request $request) {
30
     public function price(Request $request) {
21
         $price = $request->input("price");
31
         $price = $request->input("price");
22
         if($price) {
32
         if($price) {

+ 1
- 0
manage-server/routes/web.php Näytä tiedosto

70
 
70
 
71
 
71
 
72
     Route::post('/reward/price', 'RewardController@price');
72
     Route::post('/reward/price', 'RewardController@price');
73
+    Route::get('/reward/price', 'RewardController@getPrice');
73
 
74
 
74
 });
75
 });

Loading…
Peruuta
Tallenna