public static function &getInstance() { if (self::$_instance === null) { self::$_instance = new self(); } return self::$_instance; }
/** * 获取该用户的第一条违规记录 * @param $userId * @return array|mixed|null */ public function getFirstPunishInfoUserId($userId) { return Model_Fyk_UserPunish::getFirstPunishInfoUserId($userId); }
/** * @param $audit * @param $type * @return bool */ private function _insertDataByType($audit, $type) { $brokerInfo = Bll_Broker_User::getBrokerInfoByUserId(intval($audit['userId'])); $message = $this->_punishMsg($audit); $punishMsg = '发布了假房源 (' . $message . ')'; if ($type == Model_Fyk_UserPunish::DETENTION) { $openTime = strtotime('+' . Const_Fyk::DETENTION_TIME . ' day'); $openDate = intval(date('Ymd', $openTime)); } else { $openDate = 0; } $data = array('cityId' => $audit['cityId'], 'userId' => $audit['userId'], 'brokerId' => $brokerInfo['brokerId'], 'status' => $type, 'openDate' => $openDate, 'actionType' => $audit['type'], 'punishReason' => $punishMsg, 'createTime' => date('Y-m-d H:i:s', time())); $punishId = Model_Fyk_UserPunish::getInstance()->insertData($data); return $punishId; }