123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <?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\BroadcastServer;
- 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 SendCommand extends Command
- {
- /**
- * The name and signature of the console command.
- *
- * @var string
- */
- protected $signature = 'broadcast:send';
- /**
- * 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 = BroadcastServer::creatServer()->sendBroadcast();
- if ($num <= 0) {
- $this->error('---------------执行休眠了---------------------');
- sleep(3);
- }else{
- sleep(1);
- }
- $this->info('---------------执行完成了---------------------'.date('Y-m-d H:i:s'));
- }
- }
- }
|