gq 7 роки тому
батько
коміт
774b6b598f

+ 15 - 1
server/app/Console/Commands/DreamDJS.php

xqd
@@ -53,7 +53,21 @@ class DreamDJS extends Command
         $end_dream_info = DreamInfoModel::with('user')->where('end_time','<',date('Y-m-d H:i:s'))->get();
         if (count($end_dream_info)>0) {
             foreach ($end_dream_info as $item){
-//                (1)给梦想者发消息   梦想结束记录日志account_logs
+//                (1)给梦想者发消息   梦想结束记录日志account_logs  梦想结束创建二维码
+                if (empty($item->code)) {
+                    //        生成二维码
+                    $info = [];
+                    $info['transaction_id'] = date('YmdHis') . mt_rand(1000, 9999);
+                    $info['code'] = 'WECHATPAY_' . $info['transaction_id'];
+                    $code_url = env('APP_URL').'/api/user/meet?dream_id='.$item->id;
+                    $code_path = public_path('qrcodes/'.$info['code'].'.png');
+                    \QrCode::format('png')->size(500)->generate($code_url,$code_path);
+                    $code =  env('APP_URL').'/qrcodes/'.$info['code'].'.png';
+                    $item->code = $code;
+                    $item->save();
+                }
+
+
                 $dream_user = $item->user;
                 if (!empty($dream_user)) {
                     $img = $item->img;  //梦想图片

+ 0 - 44
server/app/Console/Commands/refurbish.php

xqd
@@ -1,44 +0,0 @@
-<?php
-
-namespace App\Console\Commands;
-
-use Illuminate\Console\Command;
-use Illuminate\Support\Facades\Log;
-
-class refurbish extends Command
-{
-    /**
-     * The name and signature of the console command.
-     *
-     * @var string
-     */
-//    自动加载页面数据
-    protected $signature = 'refurbish';
-
-    /**
-     * The console command description.
-     *
-     * @var string
-     */
-    protected $description = '自动刷新';
-
-    /**
-     * Create a new command instance.
-     *
-     * @return void
-     */
-    public function __construct()
-    {
-        parent::__construct();
-    }
-
-    /**
-     * Execute the console command.
-     *
-     * @return mixed
-     */
-    public function handle()
-    {
-        Log::info('i miss you ');
-    }
-}

+ 0 - 3
server/app/Console/Kernel.php

xqd xqd
@@ -14,7 +14,6 @@ class Kernel extends ConsoleKernel
      */
     protected $commands = [
         \App\Console\Commands\DreamDJS::class,
-        \App\Console\Commands\refurbish::class,
     ];
 
     /**
@@ -29,8 +28,6 @@ class Kernel extends ConsoleKernel
         //          ->hourly();
         $schedule->command('DreamDJS')
             ->everyMinute();
-        $schedule->command('refurbish')
-            ->everyMinute();
     }
 
     /**