/** * 用户验证判断 */ public static function userAuth($accountid, $pwd = false) { if (!$accountid) { return 0; } $where = " where accountid='{$accountid}'"; if (false !== $pwd) { $pwd = Mcommon::encryptPwd($pwd); $where .= " and pwd='{$pwd}' "; } $sql = "select uid from " . self::$usertable . $where; return self::dbobj()->single($sql) ? 1 : 0; }
/** * 判断并创建merge引擎的 broadcast表 */ public static function mergeBdcTable() { //首先判断是否有要联合的表 $unionTables = self::getTables(self::$broadcastPrefix, self::$broadcastTbNum); if (!$unionTables) { return false; } //第二才能判断需不需要建立表 if (Mcommon::isStrInFile(self::$mergeBdcFile, date('Y'))) { return true; } //获取修改或者创建merge表的 ddl语句 if (self::dbobj()->single("SHOW TABLES LIKE '" . self::$broadcastPrefix . "'")) { $sqlStr = \Api\Plugin\Tableddlget::alterMergeDdl(self::$broadcastPrefix, $unionTables); } else { $sqlStr = \Api\Plugin\Tableddlget::broadcastMergeTableDdl(self::$broadcastPrefix, $unionTables); } return self::dbobj()->query($sqlStr); }