Kirin 2 vuotta sitten
vanhempi
commit
e1e16ffc66
2 muutettua tiedostoa jossa 7 lisäystä ja 1 poistoa
  1. 3 1
      app/api/controller/user/UserStoreController.php
  2. 4 0
      route/api/route.php

+ 3 - 1
app/api/controller/user/UserStoreController.php

@@ -26,6 +26,8 @@ class UserStoreController
     {
         $user = $request->user();
         if (!$user['user_store_id']) return app('json')->fail('非商家身份');
+        $store_info = SystemStore::where('id', $user['user_store_id'])->find();
+        if (!$store_info) return app('json')->fail('门店不存在');
         $where['store_id'] = $user['user_store_id'];
         $list = StoreBill::where($where)
             ->field(['title', 'type'])
@@ -34,7 +36,7 @@ class UserStoreController
             ->select()
             ->toArray();
         $balance = SystemStore::where('id', $user['user_store_id'])->value('money');
-        return app('json')->successful('ok', compact('list', 'balance'));
+        return app('json')->successful('ok', compact('list', 'balance', 'store_info'));
     }
 
     /**

+ 4 - 0
route/api/route.php

@@ -60,6 +60,10 @@ Route::group(function () {
 //会员授权接口
 Route::group(function () {
 
+    Route::get('user_store/index', 'user.UserStoreController/index')->name('user_store');
+    Route::get('user_store/bill', 'user.UserStoreController/billlist')->name('user_store_billlist');
+    Route::post('user_store/extract', 'user.UserStoreController/saveExtract')->name('user_store_extract');
+
     Route::get('logout', 'AuthController/logout')->name('logout');// 退出登录
     Route::post('switch_h5', 'AuthController/switch_h5')->name('switch_h5');// 切换账号
     Route::post('binding', 'AuthController/binding_phone')->name('bindingPhone');// 绑定手机号