當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Model_Ad::getDetail方法代碼示例

本文整理匯總了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;
 }
開發者ID:pancke,項目名稱:yyaf,代碼行數:51,代碼來源:Pay.php

示例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' => '添加推廣計劃 - 支付詳情'));
 }
開發者ID:pancke,項目名稱:yyaf,代碼行數:27,代碼來源:Index.php

示例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);
     }
 }
開發者ID:pancke,項目名稱:yyaf,代碼行數:67,代碼來源:Adsh.php

示例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);
 }
開發者ID:pancke,項目名稱:yyaf,代碼行數:16,代碼來源:Ad.php

示例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' => '自媒體中心 - 提交上線地址'));
     }
 }
開發者ID:pancke,項目名稱:yyaf,代碼行數:40,代碼來源:Mcenter.php

示例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);
     }
 }
開發者ID:pancke,項目名稱:yyaf,代碼行數:50,代碼來源:Ad.php

示例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>
//.........這裏部分代碼省略.........
開發者ID:pancke,項目名稱:yyaf,代碼行數:101,代碼來源:Mediaorder.php

示例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' => '媒體中心'));
 }
開發者ID:pancke,項目名稱:yyaf,代碼行數:71,代碼來源:Media.php

示例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);
 }
開發者ID:pancke,項目名稱:yyaf,代碼行數:32,代碼來源:Acenter.php

示例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;
 }
開發者ID:pancke,項目名稱:yyaf,代碼行數:46,代碼來源:Finance.php


注:本文中的Model_Ad::getDetail方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。