Browse Source

wesmiler 报恩寺项目提交

wesmiler 4 years ago
parent
commit
840edb0895
2 changed files with 17 additions and 0 deletions
  1. 16 0
      app/Http/Controllers/IndexController.php
  2. 1 0
      routes/web.php

+ 16 - 0
app/Http/Controllers/IndexController.php

@@ -26,6 +26,7 @@ use App\Services\OrdersService;
 use App\Services\RedisService;
 use App\Services\TradeService;
 use App\Services\UserService;
+use App\Services\WechatService;
 
 /**
  * 系统主页控制器
@@ -100,6 +101,21 @@ class IndexController extends Backend
     }
 
     /**
+     * 二维码
+     *
+     */
+    public function qrcode(){
+        // 二维码
+        $url = env('WEB_URL') . '/pages/my/sign?type=1';
+        $qrcode = WechatService::makeNormalQrcode($url);
+        $info['master'] = $qrcode ? get_image_url($qrcode) : '';
+        $url = env('WEB_URL') . '/pages/my/sign?type=2';
+        $qrcode = WechatService::makeNormalQrcode($url);
+        $info['yigong'] = $qrcode ? get_image_url($qrcode) : '';
+        return message(MESSAGE_OK,true, $info);
+    }
+
+    /**
      * 工作台统计数据
      * @return array
      */

+ 1 - 0
routes/web.php

@@ -76,6 +76,7 @@ Route::post('/index/updateUserInfo', [IndexController::class, 'updateUserInfo'])
 Route::post('/index/updatePwd', [IndexController::class, 'updatePwd']);
 Route::post('/index/clearCache', [IndexController::class, 'clearCache']);
 Route::post('/index/statistics', [IndexController::class, 'statistics']);
+Route::post('/index/qrcode', [IndexController::class, 'qrcode']);
 Route::post('/index/counts', [IndexController::class, 'counts']);
 Route::post('/index/tradeRank', [IndexController::class, 'tradeRank']);
 Route::post('/index/tableData', [IndexController::class, 'tableData']);