示例#1
0
 public function getColorDetail($id)
 {
     $c = new Color();
     $result = $c->getVotes($id)->fetch();
     $votes = $result[0] === null ? 0 : $result[0];
     header('Content-Type: application/json');
     echo json_encode(['votes' => $votes]);
 }