123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php
- /**
- 测试类
- */
- namespace App\Console\Commands\Tool;
- use Log;
- use Illuminate\Console\Command;
- use App\Modules\User\Services\UserService;
- use App\Modules\User\Services\UserSignService;
- use App\Modules\Book\Services\BookConfigService;
- use App\Modules\OfficialAccount\Services\ForceSubscribeService;
- use App\Modules\OfficialAccount\Services\OfficialAccountService;
- use App\Modules\User\Services\ReadRecordService;
- use DB;
- class TestSmartPush extends Command
- {
- /**
- * 执行命令 Tool:TestSmartPush
- *
- * The name and signature of the console command.
- *
- * @var string
- */
- protected $signature = 'Tool:TestSmartPush';
- /**
- * The console command description.
- *
- * @var string
- */
- protected $description = '智能推送测试';
- /**
- * Execute the console command.
- *
- * @return mixed
- */
- public function handle()
- {
- ini_set('memory_limit', '1024M');
- print_r('memory_used:'.memory_get_usage()."\n");
- print_r("======智能推送测试【任务执行开始】=====".date("y-m-d H:i:s"."\n"));
- $uid=6;
- // $book_num=2;
- // $bid=2;
-
- // // $recommend_books = BookConfigService::getSimpleChannelBookLoop($bid,$book_num,$uid);
- // // \Log::info('$recommend_books');
- // // \Log::info($recommend_books);
-
- // $distribution_channel_id = 14;
- // $url = 'https://site2.yunqibook.com/reader?bid=2JWv0Xk1B3yqYRPxxWR6Gejno54PZrO9&cid=485877&fromsource=smart_push';
-
- // $result = OfficialAccountService::get_short_url($distribution_channel_id,$url);
-
- // $result = ReadRecordService::getFirstReadRecord($uid);
- // for($i =109861725;$i<=109861735;$i++){
- // UserSignService::signToday($i);
- // }
-
- // 注册动作-》回调订单
- $action_type = 'CallBackOrder';
- $param = [
- 'order_sn' => '123',
- 'openid' => '123',// 没有openid,用uid写log
- ];
- UserService::PushUserActionToQueue($action_type,14,$param);
-
- print_r("======智能推送测试 【任务执行结束】=====".date("y-m-d H:i:s"."\n"));
- print_r('memory_used:'.memory_get_usage()."\n");
- }
- }
|