Ver Fonte

0727-0204-h02

Zory há 1 semana atrás
pai
commit
e3ba610c10
1 ficheiros alterados com 25 adições e 0 exclusões
  1. 25 0
      app/command/MsgStatus.php

+ 25 - 0
app/command/MsgStatus.php

@@ -0,0 +1,25 @@
+<?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;
+    }
+
+}