gq 7 years ago
parent
commit
d676df78c1

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

xqd xqd xqd
@@ -2,6 +2,7 @@
 
 namespace App\Console\Commands;
 
+use App\Models\AccountLog;
 use App\Models\DreamInfoModel;
 use App\Models\SupportDreamModel;
 use App\Models\SystemInfoModel;
@@ -10,10 +11,12 @@ use Illuminate\Console\Command;
 use Illuminate\Support\Facades\Auth;
 use App\Helper\JpushHelper;
 use Illuminate\Support\Facades\Log;
+use App\Helper\LogHelper;
+
 
 class DreamDJS extends Command
 {
-    use JpushHelper;
+    use JpushHelper,LogHelper;
     /**
      * The name and signature of the console command.
      *
@@ -47,12 +50,21 @@ class DreamDJS extends Command
     {
         //执行逻辑
         Log::info('------------通知消息begin-----------');
-
         $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)给梦想者发消息
+//                (1)给梦想者发消息   梦想结束记录日志account_logs
                 $dream_user = $item->user;
+                $img = $item->img;  //梦想图片
+                $arr = [
+                    'from_type'=>'梦想币',
+                    'from_id'=>$dream_user->id,
+                    'from_name'=>$dream_user->nickname,
+                    'op'=>'梦想结束',
+                    'from_amount'=>$item->get_coin,
+                    'to_type'=>'梦想币',
+                ];
+
                 if (!empty($dream_user)) {
                     $message = "你的梦想《".$item->name."》已结束,点击了解接下来的步骤";
                     $info = $dream_user->nickname.'会以你提供的微信/电话联系你约好时间地点亲自感谢你给予的支持和鼓励。如果你不希望见面或

+ 32 - 0
server/database/migrations/2017_11_03_111416_alert_image_to_system_info_table.php

xqd
@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AlertImageToSystemInfoTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('system_info', function (Blueprint $table) {
+            $table->string('image')->default('')->change();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('system_info', function (Blueprint $table) {
+            //
+        });
+    }
+}