TestSmartPush.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /**
  3. 测试类
  4. */
  5. namespace App\Console\Commands\Tool;
  6. use Log;
  7. use Illuminate\Console\Command;
  8. use App\Modules\User\Services\UserService;
  9. use App\Modules\Book\Services\BookConfigService;
  10. use App\Modules\OfficialAccount\Services\ForceSubscribeService;
  11. use App\Modules\OfficialAccount\Services\OfficialAccountService;
  12. use App\Modules\User\Services\ReadRecordService;
  13. use DB;
  14. class TestSmartPush extends Command
  15. {
  16. /**
  17. * 执行命令 Tool:TestSmartPush
  18. *
  19. * The name and signature of the console command.
  20. *
  21. * @var string
  22. */
  23. protected $signature = 'Tool:TestSmartPush';
  24. /**
  25. * The console command description.
  26. *
  27. * @var string
  28. */
  29. protected $description = '智能推送测试';
  30. /**
  31. * Execute the console command.
  32. *
  33. * @return mixed
  34. */
  35. public function handle()
  36. {
  37. ini_set('memory_limit', '1024M');
  38. print_r('memory_used:'.memory_get_usage()."\n");
  39. print_r("======智能推送测试【任务执行开始】=====".date("y-m-d H:i:s"."\n"));
  40. $uid=6;
  41. // $book_num=2;
  42. // $bid=2;
  43. // // $recommend_books = BookConfigService::getSimpleChannelBookLoop($bid,$book_num,$uid);
  44. // // \Log::info('$recommend_books');
  45. // // \Log::info($recommend_books);
  46. // $distribution_channel_id = 14;
  47. // $url = 'https://site2.yunqibook.com/reader?bid=2JWv0Xk1B3yqYRPxxWR6Gejno54PZrO9&cid=485877&fromsource=smart_push';
  48. // $result = OfficialAccountService::get_short_url($distribution_channel_id,$url);
  49. $result = ReadRecordService::getFirstReadRecord($uid);
  50. \Log::info($result);
  51. print_r("======智能推送测试 【任务执行结束】=====".date("y-m-d H:i:s"."\n"));
  52. print_r('memory_used:'.memory_get_usage()."\n");
  53. }
  54. }