本文整理汇总了PHP中Model_Ad::getDetail方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_Ad::getDetail方法的具体用法?PHP Model_Ad::getDetail怎么用?PHP Model_Ad::getDetail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model_Ad
的用法示例。
在下文中一共展示了Model_Ad::getDetail方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: adAction
/**
* 广告支付
*/
public function adAction()
{
// 判断广告主是否已登录
$aCurrUser = $this->getCurrUser(Model_User::TYPE_AD);
if (empty($aCurrUser)) {
return $this->showMsg('请先登录', false);
}
$iAdID = intval($this->getParam('id'));
$aAd = Model_Ad::getDetail($iAdID);
if (empty($aAd)) {
return $this->showMsg('推广计划不存在', false);
}
if ($aAd['iPayStatus'] == 1) {
return $this->showMsg('该推广计划已付款', false);
}
$paypass = $this->getParam('paypass');
$usmoney = intval($this->getParam('usmoney'));
$paytype = $this->getParam('paytype');
$aUser = Model_User::getDetail($aCurrUser['iUserID']);
$iPayMoney = $aAd['iTotalMoney'];
if ($usmoney == 1) {
if ($aUser['sPayPass'] != Model_User::makePassword($paypass)) {
return $this->showMsg('支付密码错误', false);
}
if ($aUser['iMoney'] >= $iPayMoney) {
$iPayID = Model_Finance::payAd($aUser, $aAd, 0);
if ($iPayID == 0) {
return $this->showMsg('支付失败,请稍后再试', false);
}
$iPayMoney = 0;
} else {
$iPayMoney = $iPayMoney - $aUser['iMoney'];
}
}
if ($iPayMoney == 0) {
return $this->showMsg('/payment/pay/success/id/' . $iPayID . '.html', 1);
}
$aParam = array('orderid' => Model_Finance::ORDER_AD . $iAdID, 'subject' => '51wom', 'body' => '在线支付', 'total_fee' => $iPayMoney);
switch ($paytype) {
case 'alipay':
return $this->showMsg('/payment/alipay/pay.html?' . http_build_query($aParam), 2);
break;
case 'weixin':
return $this->showMsg('/payment/weixin/pay.html?' . http_build_query($aParam), 3);
break;
}
return false;
}
示例2: adAction
/**
* 推广详情
*/
public function adAction()
{
$iAdID = (int) $this->getParam('id', 0);
$aAd = Model_Ad::getDetail($iAdID);
if (empty($aAd)) {
return $this->show404();
}
$aSetting = Model_Ad::getSetting($aAd);
if (!empty($aSetting) && isset($aSetting['sForwardImg'])) {
$aSetting['aForwardImg'] = explode(',', $aSetting['sForwardImg']);
}
$aList = Model_AdMedia::getAll(array('iAdID' => $iAdID, 'iChoose' => 1, 'iStatus >' => 0));
foreach ($aList as $k => &$aRow) {
$aRow['aAd'] = Model_Ad::getDetail($aRow['iAdID']);
$aRow['aMedia'] = Model_Media::getDetail($aRow['iMediaID']);
}
$this->assign('aStatus', Model_AdMedia::$aStatus);
$this->assign('aTitle', Model_Media::$aPos[$aAd['iMediaType']]);
$this->assign('aSetting', $aSetting);
$this->assign('aAd', $aAd);
$this->assign('aList', $aList);
$this->assign('iType', $this->getParam('type', 1));
$this->setMeta('ad_add', array('sTitle' => '添加推广计划 - 支付详情'));
}
示例3: editAction
/**
* 广告修改
*/
public function editAction()
{
if ($this->_request->isPost()) {
$aAd = $this->_checkData('update');
if (empty($aAd)) {
return null;
}
$aAd['iAdID'] = intval($this->getParam('iAdID'));
$aOldAd = Model_Ad::getDetail($aAd['iAdID']);
if (empty($aOldAd)) {
return $this->showMsg('广告不存在!', false);
}
if (1 == Model_Ad::updData($aAd)) {
if ($aOldAd['iStatus'] == Model_Ad::STATUS_WAIT_APPROVE || $aOldAd['iStatus'] == Model_Ad::STATUS_APPROVE_NO && $aAd['iStatus'] == Model_Ad::STATUS_APPROVE_OK) {
$aMediaList = Model_AdMedia::getMediaByAd($aAd['iAdID'], Model_AdMedia::STATUS_CHECK, 1);
foreach ($aMediaList as $aMedia) {
Model_AdMedia::updStatus($aMedia['iAutoID'], Model_AdMedia::STATUS_RECEIVE);
}
// 邮件通知
$sTitle = Model_Kv::getValue('media_receive_order_email_title');
$sContent = Model_Kv::getValue('media_receive_order_email_content');
// 短信通知
$iTempID = Util_Common::getConf(3, 'aSmsTempID');
foreach ($aMediaList as $aMedia) {
$aUser = Model_User::getDetail($aMedia['iMUserID']);
Util_Mail::send($aUser['sEmail'], $sTitle, $sContent, array($aMedia['iMoney']));
Util_Sms::sendTemplateSms($aUser['sMobile'], array($aMedia['iMoney']), $iTempID);
// echo $sTitle, "\n", $sContent, "\n", $aUser['sEmail'], $aUser['sMobile'], $iTempID;
}
}
return $this->showMsg('广告更新成功!', true);
} else {
return $this->showMsg('广告更新失败!', false);
}
} else {
$iAdID = intval($this->getParam('id'));
$aAd = Model_Ad::getDetail($iAdID);
$aAd['iMoney'] = Model_AdMedia::getDetail($aAd['iAdID'])['iMoney'];
$aAd['sCatID'] = isset($aAd['sCatID']) && sCatID != '' ? explode(',', $aAd['sCatID']) : '';
$aAd['sCityID'] = isset($aAd['sCityID']) && sCatID != '' ? explode(',', $aAd['sCityID']) : '';
$iType = $aAd['iMediaType'];
$aCategory = array();
switch ($iType) {
case Model_Media::TYPE_WEIXIN:
$aCategory = Model_Domain::getOption(Model_Domain::TYPE_MEDIA_WEIXIN_CATEGORY);
break;
case Model_Media::TYPE_FRIEND:
$aCategory = Model_Domain::getOption(Model_Domain::TYPE_MEDIA_FRIEND_CATEGORY);
break;
case Model_Media::TYPE_WEIBO:
$aCategory = Model_Domain::getOption(Model_Domain::TYPE_MEDIA_WEIBO_CATEGORY);
break;
case Model_Media::TYPE_NEWS:
$aCategory = Model_Domain::getOption(Model_Domain::TYPE_MEDIA_NEWS_CATEGORY);
break;
}
$aCity = Model_City::getPairCitys(Model_City::TYPE_FRONT);
$aUser = Model_User::getDetail($aAd['iUserID']);
$this->assign('aUser', $aUser);
$this->assign('aAd', $aAd);
$this->assign('aCategory', $aCategory);
$this->assign('aCity', $aCity);
}
}
示例4: delAction
/**
* 删除推广
*/
public function delAction()
{
$iAdID = intval($this->getParam('id'));
$aAd = Model_Ad::getDetail($iAdID);
if (empty($aAd) || $aAd['iUserID'] != $this->aCurrUser['iUserID']) {
return $this->showMsg('数据异常', false);
}
if ($aAd['iPayStatus'] == 1) {
return $this->showMsg('该推广计划已经支付,不允许删除', false);
}
Model_Ad::delData($iAdID);
return $this->showMsg('删除成功', true);
}
示例5: onlineAction
/**
* 进行投放
*/
public function onlineAction()
{
$iAutoID = intval($this->getParam('id'));
$aAdMedia = Model_AdMedia::getDetail($iAutoID);
if (empty($aAdMedia)) {
return $this->show404('订单不存在!');
}
if ($aAdMedia['iStatus'] != Model_AdMedia::STATUS_PUSH) {
return $this->show404('此订单您已经处理过了');
}
if ($this->isPost()) {
$sOnlineUrl = $this->getParam('sOnlineUrl');
$aErr = array();
if (!Util_Validate::isAbsoluteUrl($sOnlineUrl)) {
$aErr['sOnlineUrl'] = '请输入正确的推广地址';
}
if (!empty($aErr)) {
return $this->showMsg($aErr, false);
}
$aAd = Model_Ad::getDetail($aAdMedia['iAdID']);
Model_AdMedia::updData(array('iAutoID' => $iAutoID, 'sOnlineUrl' => $sOnlineUrl, 'iStatus' => Model_AdMedia::STATUS_SUBMIT_EFFECT));
// 邮件通知
$sTitle = Model_Kv::getValue('media_runing_email_title');
$sContent = Model_Kv::getValue('media_runing_email_content');
// 短信通知
$iTempID = Util_Common::getConf(10, 'aSmsTempID');
$aUser = Model_User::getDetail($aAdMedia['iAUserID']);
$aMedia = Model_Media::getDetail($aAdMedia['iMediaID']);
Util_Tools::sendMail($aUser['sEmail'], $sTitle, $sContent, array($aMedia['sMediaName']));
Util_Sms::sendTemplateSms($aUser['sMobile'], array($aMedia['sMediaName']), $iTempID);
// echo $sTitle, "\n", $sContent, "\n", $aUser['sEmail'], $aUser['sMobile'], $iTempID;
return $this->showMsg('操作成功', true);
} else {
$this->assign('aAdMedia', $aAdMedia);
$this->setMeta('mcenter_page', array('sTitle' => '自媒体中心 - 提交上线地址'));
}
}
示例6: editAction
/**
* 广告修改
*/
public function editAction()
{
if ($this->_request->isPost()) {
$aAd = $this->_checkData('update');
if (empty($aAd)) {
return null;
}
$aAd['iAdID'] = intval($this->getParam('iAdID'));
$aOldAd = Model_Ad::getDetail($aAd['iAdID']);
if (empty($aOldAd)) {
return $this->showMsg('广告不存在!', false);
}
if (1 == Model_Ad::updData($aAd)) {
return $this->showMsg('广告更新成功!', true);
} else {
return $this->showMsg('广告更新失败!', false);
}
} else {
$iAdID = intval($this->getParam('id'));
$aAd = Model_Ad::getDetail($iAdID);
$aAd['sCatID'] = isset($aAd['sCatID']) && sCatID != '' ? explode(',', $aAd['sCatID']) : '';
$aAd['sCityID'] = isset($aAd['sCityID']) && sCatID != '' ? explode(',', $aAd['sCityID']) : '';
$iType = $aAd['iMediaType'];
$aCategory = array();
switch ($iType) {
case Model_Media::TYPE_WEIXIN:
$aCategory = Model_Domain::getOption(Model_Domain::TYPE_MEDIA_WEIXIN_CATEGORY);
break;
case Model_Media::TYPE_FRIEND:
$aCategory = Model_Domain::getOption(Model_Domain::TYPE_MEDIA_FRIEND_CATEGORY);
break;
case Model_Media::TYPE_WEIBO:
$aCategory = Model_Domain::getOption(Model_Domain::TYPE_MEDIA_WEIBO_CATEGORY);
break;
case Model_Media::TYPE_NEWS:
$aCategory = Model_Domain::getOption(Model_Domain::TYPE_MEDIA_NEWS_CATEGORY);
break;
}
$aCity = Model_City::getPairCitys(Model_City::TYPE_FRONT);
$aAd['iMoney'] = Model_AdMedia::getDetail($aAd['iAdID'])['iMoney'];
$aUser = Model_User::getDetail($aAd['iUserID']);
$this->assign('aUser', $aUser);
$this->assign('aAd', $aAd);
$this->assign('aCategory', $aCategory);
$this->assign('aCity', $aCity);
}
}
示例7: explodeAction
/**
* 导出
*/
public function explodeAction()
{
$uWhere = array();
$aParam = $this->getParams();
$userid = '';
if (!empty($aParam['sRealName'])) {
$uWhere['sRealName LIKE'] = '%' . $aParam['sRealName'] . '%';
$data_user = Model_User::getAll(array('where' => $uWhere));
$useridArr = array();
foreach ($data_user as $val) {
if ($val['iUserID'] != '') {
$useridArr[] = $val['iUserID'];
}
}
if (count($useridArr) > 0) {
$userid = implode(',', array_unique($useridArr));
}
}
$aWhere = array();
if (!empty($aParam['iUserID'])) {
$aWhere['iUserID'] = $aParam['iUserID'];
}
if ($userid != '') {
$aWhere['iUserID IN'] = $userid;
}
if (!empty($aParam['iPayment']) && $aParam['iPayment'] != '') {
$aWhere['iPayment'] = $aParam['iPayment'];
}
if (!empty($aParam['iSource']) && $aParam['iSource'] != '') {
$aWhere['iSource'] = $aParam['iSource'];
}
if (!empty($aParam['sRealName']) && $aParam['sRealName'] != '') {
$aWhere['sRealName LIKE'] = '%' . $aParam['sRealName'] . '%';
}
if (!empty($aParam['iPayType']) && $aParam['iPayType'] != '') {
$aWhere['iPayType'] = $aParam['iPayType'];
}
if (!empty($aParam['iPayStatus']) && $aParam['iPayStatus'] != '') {
$aWhere['iPayStatus'] = $aParam['iPayStatus'];
}
$aList = Model_AdMedia::getAll(array('where', $aWhere));
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=资源订单_" . date('Y-m-d', time()) . ".xls");
$str_explode = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /><title>导出</title><style>td{text-align:center;font-size:12px;font-family:Arial, Helvetica, sans-serif;border:#1C7A80 1px solid;color:#152122;width:100px;}table,tr{border-style:none;}.title{background:#7DDCF0;color:#FFFFFF;font-weight:bold;}</style></head><body>";
$str_explode .= '<table cellspacing="0" cellpadding="3" rules="rows" border="1" id="" style="border-style:None;width:100%;border-collapse:collapse;">
<tr>
<th scope="col">用户名称/th>
<th scope="col">广告名称</th>
<th scope="col">资源媒体名称</th>
<th scope="col">广告位</th>
<th scope="col">价格</th>
<th scope="col">执行时间</th>
<th scope="col">支付状态</th>
<th scope="col">状态</th>
<th scope="col">时间</th>
</tr>';
foreach ($aList as $key => $val) {
$aAd = Model_Ad::getDetail($val['iAdID']);
//资源
$aMedia = Model_Media::getDetail($val['iMediaID']);
$sMediaName = $aMedia['sMediaName'];
//用户
$aUser = Model_User::getDetail($val['iUserID']);
$sEmail = $aUser['sEmail'];
//广告位
$aTitle = array(Model_Media::TYPE_WEIXIN => array('1' => '单图文报价', '2' => '第一条报价', '3' => '第二条报价', '4' => '其它位置价'), Model_Media::TYPE_FRIEND => array('1' => '转发报价', '2' => '直发报价'), Model_Media::TYPE_WEIBO => array('1' => '转发报价', '2' => '直发报价'));
$iPos = '';
if ($aAd['iMediaType'] != '') {
$iPos = $aTitle[$aAd['iMediaType']][$val['iPos']];
}
//支付状态
$iPayStatusName = '';
if ($val['iPayStatus'] == '0') {
$iPayStatusName = '未支付';
} elseif ($val['iPayStatus'] == '1') {
$iPayStatusName = '已支付';
}
$iMoney = $val['iMoney'];
$iPlanTime = '';
if ($val['iPlanTime'] != '' && $val['iPlanTime'] > 0) {
$iPlanTime = date('Y-m-d H:i', $val['iPlanTime']);
}
//状态
$iStatusName = '';
if ($val['iStatus'] == '1') {
$iStatusName = '等待接单';
} elseif ($val['iStatus'] == '2') {
$iStatusName = '等待执行';
} elseif ($val['iStatus'] == '3') {
$iStatusName = '执行中';
} elseif ($val['iStatus'] == '4') {
$iStatusName = '已完成';
} elseif ($val['iStatus'] == '5') {
$iStatusName = '拒绝接单';
}
$iCreateTime = date('Y-m-d H:i:s', $val['iCreateTime']);
$str_explode .= '<tr>
//.........这里部分代码省略.........
示例8: indexAction
/**
* 自媒体中心
*/
public function indexAction()
{
$aParam = $this->getParams();
$aParam['type'] = isset($aParam['type']) ? intval($aParam['type']) : Model_Media::TYPE_WEIXIN;
$iAdID = (int) $this->getParam('id');
$aAd = null;
if ($iAdID > 0) {
$aAd = Model_Ad::getDetail($iAdID);
}
if (!empty($aAd)) {
$aParam['type'] = $aAd['iMediaType'];
$sReferer = $this->getRequest()->getHttpReferer();
if (strpos($sReferer, '/ad/add') > 0) {
if (!empty($aAd['sCatID'])) {
$aParam['catid'] = intval($aAd['sCatID']);
}
if (!empty($aAd['sCityID'])) {
$aParam['city'] = explode(',', $aAd['sCityID']);
}
}
}
$aData = Model_Media::search($aParam);
foreach ($aData['aList'] as &$aRow) {
$aRow['sCatName'] = Model_Media::getCategoryNames($aRow['iMediaID']);
}
switch ($aParam['type']) {
case Model_Media::TYPE_WEIXIN:
$aData['aType'] = Model_Domain::getOption(Model_Domain::TYPE_MEDIA_WEIXIN_CATEGORY);
$aData['aTag'] = Model_Domain::getOption(Model_Domain::TYPE_MEDIA_WEIXIN_TAG);
break;
case Model_Media::TYPE_FRIEND:
$aData['aType'] = Model_Domain::getOption(Model_Domain::TYPE_MEDIA_FRIEND_CATEGORY);
$aData['aTag'] = Model_Domain::getOption(Model_Domain::TYPE_MEDIA_FRIEND_TAG);
break;
case Model_Media::TYPE_WEIBO:
$aData['aType'] = Model_Domain::getOption(Model_Domain::TYPE_MEDIA_WEIBO_CATEGORY);
$aData['aTag'] = Model_Domain::getOption(Model_Domain::TYPE_MEDIA_WEIBO_TAG);
break;
case Model_Media::TYPE_NEWS:
$aData['aType'] = Model_Domain::getOption(Model_Domain::TYPE_MEDIA_NEWS_CATEGORY);
$aData['aTag'] = Model_Domain::getOption(Model_Domain::TYPE_MEDIA_NEWS_TAG);
break;
}
$aData['aPrice'] = Model_Price::getOption();
$aData['aFollower'] = Model_Follower::getOption();
$aData['aCity'] = Model_City::getPairCitys(Model_City::TYPE_FRONT);
$aData['aLevel'] = Model_Domain::getOption(Model_Domain::TYPE_MEDIA_RECOMMEND);
$aData['aAd'] = $aAd;
if (!empty($aData['aAd'])) {
$aData['aChooseID'] = Model_AdMedia::getCol(array('where' => array('iStatus >' => 0, 'iAdID' => $iAdID)), 'iMediaID');
}
if (empty($aData['aChooseID'])) {
$sCookieKey = 'media_choose_' . $aParam['type'];
$aData['aChooseID'] = !empty($_COOKIE[$sCookieKey]) ? explode(',', $_COOKIE[$sCookieKey]) : array();
}
$aData['aChoose'] = array();
foreach ($aData['aChooseID'] as $k => $v) {
$aMedia = Model_Media::getDetail($v);
if (empty($aMedia)) {
continue;
}
$aData['aChoose'][] = $aMedia;
}
$this->assign('aData', $aData);
$this->assign('aParam', $aParam);
$this->assign('sTopMenu', empty($aAd) ? 'media' : 'aadd');
$this->setMeta('media_center', array('sTitle' => '媒体中心'));
}
示例9: finishAction
/**
* 投放完成(结算)
*
* @return boolean
*/
public function finishAction()
{
$iAutoID = intval($this->getParam('id'));
$aAdMedia = Model_AdMedia::getDetail($iAutoID);
if (empty($aAdMedia)) {
return $this->showMsg('数据出错了', false);
}
if ($aAdMedia['iStatus'] != Model_AdMedia::STATUS_CONFIRM_EFFECT) {
return $this->showMsg('你已经处理过了', false);
}
$aAd = Model_Ad::getDetail($aAdMedia['iAdID']);
Model_AdMedia::begin();
Model_AdMedia::updStatus($iAutoID, Model_AdMedia::STATUS_FINISHED);
Model_Finance::updMoney($aAdMedia['iMUserID'], array('iPayment' => Model_Finance::PAYMENT_IN, 'iSource' => Model_Finance::SOURCE_AD_CASH_IN, 'iPayType' => Model_Finance::TYPE_NO, 'iMoney' => $aAdMedia['iMoney']));
Model_AdMedia::commit();
// 邮件通知
$sTitle = Model_Kv::getValue('ad_approve_preview_email_title');
$sContent = Model_Kv::getValue('ad_approve_preview_email_content');
// 短信通知
$iTempID = Util_Common::getConf(6, 'aSmsTempID');
$aUser = Model_User::getDetail($aAdMedia['iMUserID']);
$aMedia = Model_Media::getDetail($aAdMedia['iMediaID']);
Util_Mail::send($aUser['sEmail'], $sTitle, $sContent, array($aMedia['sEmail']));
Util_Sms::sendTemplateSms($aUser['sMobile'], array($aMedia['sEmail']), $iTempID);
// echo $sTitle, "\n", $sContent, "\n", $aUser['sEmail'], $aUser['sMobile'], $iTempID;
return $this->showMsg('操作成功', true);
}
示例10: pay
/**
* 充值
*
* @param unknown $sType
* @param unknown $sOrderID
* @param unknown $iMoney
* @param unknown $aArg
*/
public static function pay($sOrderID, $iPayMoney, $aArg)
{
Model_Finance::begin();
$aArg['sMyOrder'] = $sOrderID;
$sType = $sOrderID[0];
$iOrderID = substr($sOrderID, 1);
if ($sType == self::ORDER_AD) {
// 广告
$aAd = Model_Ad::getDetail($iOrderID);
if ($aAd && $aAd['iPayStatus'] == 0) {
$aUser = Model_User::getDetail($aAd['iUserID']);
if (ENV_SCENE == 'dev') {
$iPayMoney = $aAd['iTotalMoney'] - $aUser['iMoney'];
}
$iPayID = self::payAd($aUser, $aAd, $iPayMoney, $aArg);
} elseif ($aAd && $aAd['iPayStatus'] == 1) {
$iPayID = $aAd['iPayID'];
} else {
$iPayID = 0;
}
} else {
$aArg['iPayment'] = Model_Finance::PAYMENT_IN;
$aArg['iSource'] = Model_Finance::SOURCE_SELF_CASH_IN;
$aFinance = Model_Finance::getDetail($iOrderID);
if ($aFinance && $aFinance['iPayStatus'] == 0) {
$aUser = Model_User::getDetail($aFinance['iUserID']);
if (ENV_SCENE == 'dev') {
$iPayMoney = $aFinance['iPayMoney'];
}
$aArg['iMoney'] = $iPayMoney;
$iPayID = self::updMoney($aUser, $aArg, $iOrderID);
} else {
$iPayID = $iOrderID;
}
}
Model_Finance::commit();
return $iPayID;
}