public function __construct()
 {
     parent::__construct();
     // 删除活动配置SQL语句
     $this->SQL_DELETE_CONFIG = "DELETE FROM " . C('DB_PREFIX') . "wevote_config WHERE ";
     // 删除候选人SQL语句
     $this->SQL_DELETE_CANDIDATE = "DELETE FROM " . C('DB_PREFIX') . "wevote_candidates WHERE ";
     // 删除投票信息SQL语句
     $this->SQL_DELETE_VOTE_INFO = "DELETE FROM " . C('DB_PREFIX') . "wevote_info WHERE ";
     // 删除投票人信息SQL语句
     $this->SQL_DELETE_VOTER_INFO = "DELETE FROM " . C('DB_PREFIX') . "wevote_voters WHERE ";
     // 删除访问者信息SQL语句
     $this->SQL_DELETE_VISITOR = "DELETE FROM " . C('DB_PREFIX') . "wevote_visitors WHERE ";
 }
 public function __construct()
 {
     parent::__construct();
     // 查询所有候选人SQL语句
     $this->SQL_QUERY_CANDIDATES = "SELECT *, COALESCE(T2.count2, 0) AS count FROM " . C('DB_PREFIX') . "wevote_candidates AS T1\nLEFT JOIN (SELECT COUNT(id) AS count2, candidate_id FROM " . C('DB_PREFIX') . "wevote_info GROUP BY candidate_id) AS T2\nON T1.id = T2.candidate_id\nWHERE (action_id = %d) AND (status = 1)\nORDER BY count DESC LIMIT %d, %d";
     // 查询所有候选人总数SQL语句
     $this->SQL_QUERY_CANDIDATES_COUNT = "SELECT COUNT(id) AS count FROM " . C('DB_PREFIX') . "wevote_candidates WHERE (action_id = %d) AND (status = 1)";
     // 查询候选人SQL语句
     $this->SQL_QUERY_CANDIDATE = "SELECT * FROM " . C('DB_PREFIX') . "wevote_candidates WHERE (id = %d)";
     // 更新候选人SQL语句
     $this->SQL_UPDATE_CANDIDATE = "UPDATE " . C('DB_PREFIX') . "wevote_candidates SET title='%s', comment='%s', announce='%s', parent='%s', tel='%s', address='%s', cell='%s', picture='%s' WHERE (id = %d)";
     // 删除候选人SQL语句
     $this->SQL_DELETE_CANDIDATE = "DELETE FROM " . C('DB_PREFIX') . "wevote_candidates WHERE ";
     // 删除投票信息SQL语句
     $this->SQL_DELETE_VOTE_INFO = "DELETE FROM " . C('DB_PREFIX') . "wevote_info WHERE ";
 }