<?php
declare(strict_types=1);
function activityOracle(array $rows,string $method):array {
 if($method==='info'){if(count($rows)!==1)throw new RuntimeException('One info oracle row');$row=$rows[0];$row['activity_status']='未开始';$row['participants']=0;return ['code'=>0,'message'=>'信息获取成功','data'=>$row];}
 if($method==='lists'){foreach($rows as &$row)$row['activity_status']='未开始';unset($row);return ['code'=>0,'message'=>'请求成功','data'=>['rows'=>$rows,'total'=>count($rows)]];}
 $messages=['add'=>'新增活动成功','update'=>'编辑活动成功','able'=>'更改状态成功','delete'=>'删除活动成功'];return ['code'=>0,'message'=>$messages[$method],'data'=>[]];
}
