gq 7 年 前
コミット
2e9ef65071
2 ファイル変更54 行追加0 行削除
  1. 50 0
      server/app/Http/Controllers/Api/V1/MyController.php
  2. 4 0
      server/routes/api.php

+ 50 - 0
server/app/Http/Controllers/Api/V1/MyController.php

xqd
@@ -1516,4 +1516,54 @@ class MyController extends Controller
         return $this->api('');
     }
 
+
+    /**
+     * @api {get} /api/my/account_log 支付列表
+     * @apiDescription 支付列表
+     * @apiGroup My
+     * @apiPermission Passport
+     * @apiVersion 0.1.0
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+    {
+        "status": true,
+        "status_code": 0,
+        "message": "",
+        "data": [
+            {
+                "id": 1,
+                "from_type": "1",
+                "from_id": 1,
+                "from_name": "1",
+                "op": "",
+                "from_amount": 2,
+                "to_type": "2",
+                "to_id": 1,
+                "to_name": null,
+                "to_amount": 2,
+                "channel": "1",
+                "avatar": null,
+                "transaction_id": null,
+                "note": null,
+                "created_at": null,
+                "updated_at": null,
+                "deleted_at": null
+            }
+        ]
+    }
+     * @apiErrorExample {json} Error-Response:
+     *{
+     *  "status": false,
+     *  "status_code": 700,
+     *  "message": "操作失败",
+     *  "data": null
+     *}
+     */
+    public function accountLog()
+    {
+        $user = $this->getUser();
+        $data = AccountLog::where('to_id',$user->id)->orderBy('id','desc')->get();
+        return $this->api($data);
+    }
+
 }

+ 4 - 0
server/routes/api.php

xqd
@@ -166,6 +166,10 @@ $api->version('v1', ['namespace' => 'App\Http\Controllers\Api\V1'], function ($a
         'as' => 'my.lettershow',
         'uses' => 'MyController@letterShow',
     ]);
+    $api->get('/my/account_log', [
+        'as' => 'my.account_log',
+        'uses' => 'MyController@accountLog',
+    ]);
     $api->get('my/care', [
         'as' => 'my.care',
         'uses' => 'MyController@care',