12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- namespace app\common\command;
- use app\service\mobile_get\Gdian;
- use think\console\Command;
- use think\console\Input;
- use think\console\Output;
- class NoGd extends Command{
- protected function configure()
- {
- $this->setName('no:gd')->setDescription('广电同步号码');
- }
- protected function execute(Input $input, Output $output)
- {
- $name='command:'.$this->getName();
- try {
- $has=redis()->get($name);
- if($has){
- return;
- }
- redis()->set($name,time());
- $class=new Gdian();
- $class->fetchNo();
- }catch (\Exception $e){
- $output->error($e->getMessage());
- user_log('NoGd',[
- 'e'=>$e->getMessage(),
- 'file'=>$e->getFile(),
- 'line'=>$e->getLine(),
- 'trace'=>$e->getTrace(),
- ]);
- }
- redis()->del($name);
- }
- }
|