BF-202210271038\Administrator 3 gadi atpakaļ
vecāks
revīzija
1e4de9862d

+ 112 - 0
app/Console/Commands/ContractCommand.php

@@ -0,0 +1,112 @@
+<?php
+
+namespace App\Console\Commands;
+
+use App\Jobs\BarrageJob;
+use App\Jobs\ShopNoticeJob;
+use App\Jobs\VerifyImg;
+use App\Models\CouponGrantRange;
+use App\Models\ErrorRecord;
+use App\Models\Express;
+use App\Models\Goods;
+use App\Models\GoodsSpec;
+use App\Models\ImGroup;
+use App\Models\ImMyGroup;
+use App\Models\Member;
+use App\Models\MemberOpenId;
+use App\Models\Members;
+use App\Models\Menu;
+use App\Models\Order;
+use App\Models\OrderAccountsSet;
+use App\Models\OrderItem;
+use App\Models\PayOrder;
+use App\Models\RefundOrder;
+use App\Models\Region;
+use App\Models\SeckillGoods;
+use App\Models\Shop;
+use App\Models\ShopOrder;
+use App\Models\ShopSet;
+use App\Models\ShopUser;
+use App\Models\Withdraw;
+use App\Servers\AlbumServer;
+use App\Servers\BarrageServer;
+use App\Servers\CommentServer;
+use App\Servers\CommonServer;
+use App\Servers\ContractServer;
+use App\Servers\Coupon\CouponGrantServer;
+use App\Servers\Electricity\JdElectricityServer;
+use App\Servers\Electricity\TbElectricityServer;
+use App\Servers\ExpressServer;
+use App\Servers\GrantPondServer;
+use App\Servers\HxServer;
+use App\Servers\Icon\BanRPC;
+use App\Servers\Icon\TronRPC;
+use App\Servers\ImgServer;
+use App\Servers\ImServer;
+use App\Servers\MemberClanServer;
+use App\Servers\MemberServer;
+use App\Servers\OrderServer;
+use App\Servers\PayServer;
+use App\Servers\RedisDataServer;
+use App\Servers\RefundOrderServer;
+use App\Servers\SeckillServer;
+use App\Servers\SensitiveServer;
+use App\Servers\ShopFileServer;
+use App\Servers\ShopNoticeServer;
+use App\Servers\ShopOrderServer;
+use App\Servers\ShopServer;
+use App\Servers\UsedServer;
+use App\Servers\WeixinServer;
+use App\Servers\WxTemplateServer;
+use App\Servers\ZfbServer;
+use Illuminate\Console\Command;
+use Illuminate\Support\Facades\DB;
+use SimpleSoftwareIO\QrCode\Facades\QrCode;
+use SwooleTW\Http\Websocket\Facades\Websocket;
+use Topsdk\Topapi\TopApiClient;
+
+class ContractCommand extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'contract:clearing';
+
+    /**
+     * 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()
+    {
+        while (true) {
+            $this->info('---------------开始执行了---------------------:'.date('Y-m-d H:i:s'));
+            $num = ContractServer::creatServer()->broadcastDetection();
+            if ($num <= 0) {
+                $this->error('---------------执行休眠了---------------------');
+                sleep(3);
+            }
+            $this->info('---------------执行完成了---------------------'.date('Y-m-d H:i:s'));
+        }
+    }
+}

+ 2 - 0
app/Console/Kernel.php

@@ -5,6 +5,7 @@ namespace App\Console;
 use App\Console\Commands\ClearCacheCommand;
 use App\Console\Commands\ClearUserCommand;
 use App\Console\Commands\CodeCommand;
+use App\Console\Commands\ContractCommand;
 use App\Console\Commands\CouponCommand;
 use App\Console\Commands\OrderAffirm;
 use App\Console\Commands\OrderAutoExpressl;
@@ -29,6 +30,7 @@ class Kernel extends ConsoleKernel
     protected $commands = [
         //
         TestCommand::class,
+        ContractCommand::class
     ];
 
     /**

+ 1 - 1
app/Servers/ContractServer.php

@@ -147,7 +147,7 @@ class ContractServer
                DB::commit();
             }
         }
-
+        return $contractList->count();
     }
 
     /**