/**
* @Scheduled(cron="* * * * * *")
* @throws \Swoft\Db\Exception\DbException
*/
public function test(){
$sql = "UPDATE sl_template_task SET send_state = CASE id WHEN 45 THEN 1 WHEN 44 THEN 1 END WHERE id IN (45,44)";
$em = EntityManager::create();
$query = $em->createQuery($sql);
$query->execute();
$em->close();
echo "1\n";
}
php --ri swoole
)php -v
)Details 看了下出错的原因是因为sql语句是更新操作,而在Swoft\Db\Driver\Mysql\QueryBuilder 中 这部分判断没有生效,执行了fetch方法,而产生的语法错误问题