<?php

/*
  PHP version 5
  Copyright (c) 2002-2018 ECISP.CN、EarcLink.COM
  警告：这不是一个免费的软件，请在许可范围内使用，请尊重知识产权，侵权必究，举报有奖
  作者：黄祥云 E-mail:6326420@qq.com  QQ:6326420 TEL:18665655030 / 13797552220
*/



namespace admin_application;

class AdvertisementDB {
	public static function lastPidAdvertisement($lng = false, $atid = 0, $return_key = false) {
		if (!$atid || !espcms_ismatches($atid)) {
			return false;
		}
		$db_where = "WHERE lng='$lng' AND atid=$atid ORDER BY pid DESC LIMIT 0,1";
		$db_table = ESPCMS_DB_PREFIX . 'advert';
		$talbe_field_array = espcms_field_out($db_table, false);
		$read_info = espcms_db_read($db_table, $db_where, $talbe_field_array);
		if (!$read_info) {
			return false;
		}
		return !$return_key ? $read_info : $read_info[$return_key];
	}

}
