query($sql); return $res; } // @function 获取用户信息 // // @param userId 用户编号 // @return 用户任务信息 public function getUserInfoByUserId($userId){ return [ 'baseInfo' => [ 'age' => 29, 'sex' => '男', 'time' => date('Y-m-d H:i:s'), 'ulevel' => 2, 'place' => '长沙市岳麓区', 'weather' => '良好', ], 'physical' => [ 'isLikeSports' => '是', 'isHypertension' => '否', 'isHeartAttack' => '是', 'isAgile' => '是', 'isHardBody' => '是', ] ]; } // @function 获取任务信息 // // @param id 任务编号 // @return 任务信息 public function getTaskInfoById($id){ $db = new MysqlPdo(); $sql = "select * from wp_task WHERE id = {$id} "; $res = $db->query($sql); return isset($res[0])?$res[0]:[]; } }