| 12345678910111213141516171819202122232425 |
- <?php
- namespace app\command;
- use app\model\saas\SaasChatMsg;
- use Symfony\Component\Console\Command\Command;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- class MsgStatus extends Command
- {
- protected static string $defaultName = 'msg:status';
- protected static string $defaultDescription = '统一生成Model';
- protected function execute(InputInterface $input, OutputInterface $output): int
- {
- $output->writeln("开始更新聊天记录====>" . getDateFull());
- $total = (new SaasChatMsg)->where("is_user",0)->count();
- $output->writeln("共计{$total}条记录更新====>" . getDateFull());
- (new SaasChatMsg)->where("is_user",0)->update(["is_user" =>1 ]);
- return self::SUCCESS;
- }
- }
|