1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace App\Console\Commands\ActionTrigger\BatchWechatMaterial;
- use App\Http\Controllers\WechatController;
- use Illuminate\Console\Command;
- use DB;
- /**
- * 删除微信素材
- *
- */
- class testWechatMaterial extends Command
- {
- /**
- * The name and signature of the console command.
- *
- * @var string
- */
- protected $signature = 'get_wechat_material {--appid=}';
- /**
- * 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()
- {
- $appid = $this->option('appid');
- try{
- $WechatController = new WechatController($appid);
- $res = $WechatController->app->material->lists('news', 10, 20);
- dump($res['item'][0]['media_id']);
- dump($res['item'][1]['media_id']);
- dump($res['item'][2]['media_id']);
- dump($res['item'][3]['media_id']);
- dump($res['item'][4]['media_id']);
- dump($res['item'][5]['media_id']);
- dump($res['item'][6]['media_id']);
- dump($res['item'][7]['media_id']);
- dump($res['item'][8]['media_id']);
- dump($res['item'][9]['media_id']);
- // \Log::info('$res');
- // \Log::info($res);
- }catch(\Exception $e){
- \Log::error($e->getMessage());
- }
- return;
- }
- }
|