TestSmartPush.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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\User\Services\UserSignService;
  10. use App\Modules\Book\Services\BookConfigService;
  11. use App\Modules\OfficialAccount\Services\ForceSubscribeService;
  12. use App\Modules\OfficialAccount\Services\OfficialAccountService;
  13. use App\Modules\User\Services\ReadRecordService;
  14. use DB;
  15. class TestSmartPush extends Command
  16. {
  17. /**
  18. * 执行命令 Tool:TestSmartPush
  19. *
  20. * The name and signature of the console command.
  21. *
  22. * @var string
  23. */
  24. protected $signature = 'Tool:TestSmartPush';
  25. /**
  26. * The console command description.
  27. *
  28. * @var string
  29. */
  30. protected $description = '智能推送测试';
  31. /**
  32. * Execute the console command.
  33. *
  34. * @return mixed
  35. */
  36. public function handle()
  37. {
  38. ini_set('memory_limit', '1024M');
  39. print_r('memory_used:'.memory_get_usage()."\n");
  40. print_r("======智能推送测试【任务执行开始】=====".date("y-m-d H:i:s"."\n"));
  41. $uid=6;
  42. // $book_num=2;
  43. // $bid=2;
  44. // // $recommend_books = BookConfigService::getSimpleChannelBookLoop($bid,$book_num,$uid);
  45. // // \Log::info('$recommend_books');
  46. // // \Log::info($recommend_books);
  47. // $distribution_channel_id = 14;
  48. // $url = 'https://site2.yunqibook.com/reader?bid=2JWv0Xk1B3yqYRPxxWR6Gejno54PZrO9&cid=485877&fromsource=smart_push';
  49. // $result = OfficialAccountService::get_short_url($distribution_channel_id,$url);
  50. // $result = ReadRecordService::getFirstReadRecord($uid);
  51. // for($i =109861725;$i<=109861735;$i++){
  52. // UserSignService::signToday($i);
  53. // }
  54. // 注册动作-》回调订单
  55. $action_type = 'CallBackOrder';
  56. $param = [
  57. 'order_sn' => '123',
  58. 'openid' => '123',// 没有openid,用uid写log
  59. ];
  60. UserService::PushUserActionToQueue($action_type,14,$param);
  61. print_r("======智能推送测试 【任务执行结束】=====".date("y-m-d H:i:s"."\n"));
  62. print_r('memory_used:'.memory_get_usage()."\n");
  63. }
  64. }