BillTask.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: tandunzhao
  5. * Date: 2017/11/20
  6. * Time: 下午5:26
  7. */
  8. namespace App\Console\Commands;
  9. use App\Modules\Channel\Services\ChannelService;
  10. use App\Modules\Finance\Models\BillPayMerchant;
  11. use App\Modules\Finance\Services\BillPayMerchantService;
  12. use App\Modules\Finance\Services\BillService;
  13. use App\Modules\Finance\Services\FinanceService;
  14. use Log;
  15. use Illuminate\Console\Command;
  16. class BillTask extends Command
  17. {
  18. /**
  19. * 执行命令 php artisan bill_task
  20. *
  21. * The name and signature of the console command.
  22. *
  23. * @var string
  24. */
  25. protected $signature = 'bill_task';
  26. /**
  27. * The console command description.
  28. *
  29. * @var string
  30. */
  31. protected $description = '每日生成结算单生成';
  32. /**
  33. * Execute the console command.
  34. *
  35. * @return mixed
  36. */
  37. public function handle()
  38. {
  39. print_r("======每日生成结算单生成 【任务执行开始】=====".date("y-m-d H:i:s"."\n"));
  40. Log::info("======每日生成结算单生成 【任务执行开始】=====".date("y-m-d H:i:s"."\n"));
  41. FinanceService::makeDayDataStatistics();
  42. Log::info("======每日生成结算单生成 【任务执行结束】=====".date("y-m-d H:i:s"."\n"));
  43. print_r("======每日生成结算单生成 【任务执行结束】=====".date("y-m-d H:i:s"."\n"));
  44. }
  45. private function updateBranchAccount() {
  46. $channels = ChannelService::getAllChannels();
  47. foreach ($channels as $channel) {
  48. BillPayMerchant::where('distribution_channel');
  49. }
  50. }
  51. }