예제 #1
0
파일: Media.php 프로젝트: pancke/yyaf
    /**
     * 导出资源数据
     */
    public function explodeAction()
    {
        $iPage = intval($this->getParam('page'));
        $aWhere = array();
        $aParam = $this->getParams();
        if (!empty($aParam['iUserID'])) {
            $aWhere['iUserID'] = $aParam['iUserID'];
        }
        if (!empty($aParam['iMediaType'])) {
            $aWhere['iMediaType'] = $aParam['iMediaType'];
        }
        if (!empty($aParam['sMediaName'])) {
            $aWhere['sMediaName LIKE'] = '%' . $aParam['sMediaName'] . '%';
        }
        if (!empty($aParam['iStatus'])) {
            $aWhere['iStatus'] = $aParam['iStatus'];
        } else {
            $aWhere['iStatus IN'] = '1,2';
        }
        $aList = Model_Media::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">报价1</th>
								<th scope="col">报价2</th>
								<th scope="col">报价3</th>
								<th scope="col">报价4</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>
								<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>
								<th scope="col">标签</th>
							</tr>';
        foreach ($aList as $key => $val) {
            $id = $val['iMediaID'];
            $row = Model_User::getDetail($val['iUserID']);
            $sRealName = isset($row) && $row['sRealName'] != '' ? $row['sRealName'] : '';
            $iMediaType = '';
            if ($val['iMediaType'] == '1') {
                $iMediaType = '微信';
            } elseif ($val['iMediaType'] == '2') {
                $iMediaType = '微博';
            } elseif ($val['iMediaType'] == '3') {
                $iMediaType = '朋友圈';
            } elseif ($val['iMediaType'] == '4') {
                $iMediaType = '新闻';
            }
            $sMediaName = $val['sMediaName'];
            $sOpenName = $val['sOpenName'];
            $iFollowerNum = $val['iFollowerNum'];
            $sFollowerImg = Util_Uri::getDFSViewURL($val['sFollowerImg'], 130, 130);
            $sAvatar = Util_Uri::getDFSViewURL($val['sAvatar'], 130, 130);
            $sQRCode = Util_Uri::getDFSViewURL($val['sQRCode'], 130, 130);
            $iPrice5 = $val['iPrice5'];
            $iPrice6 = $val['iPrice6'];
            $iPrice7 = $val['iPrice7'];
            $iPrice8 = $val['iPrice8'];
            $iReadNum = $val['iReadNum'];
            $iScore = $val['iScore'];
            $iRecommendLevel = $val['iRecommendLevel'];
            $iPersonCharge = $val['iPersonCharge'];
            $iAuditperson = $val['iAuditperson'];
            $rowattr = Model_Domain::getDetail($val['iAttribute']);
            $iAttribute = isset($rowattr['sName']) ? $rowattr['sName'] : '';
            //属性
            $sWxLink = $val['sWxLink'];
            $rowver = Model_Domain::getDetail($val['iVerifyState']);
            $iVerifyState = isset($rowver['sName']) ? $rowver['sName'] : '';
            //认证
            $sIntroduction = $val['sIntroduction'];
            $sTypeInfo = $val['sTypeInfo'];
            $sCooperateLevelInfo = '';
            if ($val['sCooperateLevelInfo'] != '') {
                $rowlevel = Model_Domain::getAll(array('where' => array('iAutoID IN' => $val['sCooperateLevelInfo'])));
                //合作等级
                if (isset($rowlevel) && count($rowlevel) > 0) {
                    foreach ($rowlevel as $lrow) {
                        $sCooperateLevelInfo .= ' ' . $lrow['sName'];
                    }
                }
            }
            $sCertifiedText = $val['sCertifiedText'];
            $iClickNumber = $val['iClickNumber'];
            $iChoiceNumber = $val['iChoiceNumber'];
            $iArticleNumber = $val['iArticleNumber'];
            $iZambiaNumber = $val['iZambiaNumber'];
            //分类
            $data_cat = Model_MediaCategory::getAll(array('where' => array('iMediaID' => $val['iMediaID'], 'iStatus' => 1)));
            $aCategory = '';
            if (isset($data_cat) && count($data_cat) > 0) {
                $iAutoID = array();
                foreach ($data_cat as $val_cat) {
                    $iAutoID[] = $val_cat['iCategoryID'];
                }
                if (count($iAutoID) > 0) {
                    $rowcat = Model_Domain::getAll(array('where' => array('iAutoID IN' => implode(',', array_unique($iAutoID)), 'iStatus' => '1')));
                    if (isset($rowcat) && count($rowcat) > 0) {
                        foreach ($rowcat as $vcat) {
                            $aCategory .= ',' . $vcat['sName'];
                        }
                    }
                }
            }
            //城市
            $data_city = Model_MediaCity::getAll(array('where' => array('iMediaID' => $val['iMediaID'], 'iStatus' => 1)));
            $aCity = '';
            if (isset($data_city) && count($data_city) > 0) {
                $iAutoID = array();
                foreach ($data_city as $val_City) {
                    $iAutoID[] = $val_City['iCityID'];
                }
                if (count($iAutoID) > 0) {
                    $rowCity = Model_Domain::getAll(array('where' => array('iAutoID IN' => implode(',', array_unique($iAutoID)), 'iStatus' => '1')));
                    if (isset($rowCity) && count($rowCity) > 0) {
                        foreach ($rowCity as $vCity) {
                            $aCity .= ',' . $vCity['sName'];
                        }
                    }
                }
            }
            //圈子
            $data_cricle = Model_MediaCricle::getAll(array('where' => array('iMediaID' => $val['iMediaID'], 'iStatus' => 1)));
            $aCricle = '';
            if (isset($data_cricle) && count($data_cricle) > 0) {
                $iAutoID = array();
                foreach ($data_cricle as $val_Cricle) {
                    $iAutoID[] = $val_Cricle['iCricleID'];
                }
                if (count($iAutoID) > 0) {
                    $rowCricle = Model_Domain::getAll(array('where' => array('iAutoID IN' => implode(',', array_unique($iAutoID)), 'iStatus' => '1')));
                    if (isset($rowCricle) && count($rowCricle) > 0) {
                        foreach ($rowCricle as $vCricle) {
                            $aCricle .= ',' . $vCricle['sName'];
                        }
                    }
                }
            }
            //标签
            $data_tag = Model_MediaTag::getAll(array('where' => array('iMediaID' => $val['iMediaID'], 'iStatus' => 1)));
            $aTag = '';
            if (isset($data_tag) && count($data_tag) > 0) {
                $iAutoID = array();
                foreach ($data_tag as $val_Tag) {
                    $iAutoID[] = $val_Tag['iTagID'];
                }
                if (count($iAutoID) > 0) {
                    $rowTag = Model_Domain::getAll(array('where' => array('iAutoID IN' => implode(',', array_unique($iAutoID)), 'iStatus' => '1')));
                    if (isset($rowTag) && count($rowTag) > 0) {
                        foreach ($rowTag as $vTag) {
                            $aTag .= ',' . $vTag['sName'];
                        }
                    }
                }
            }
            $iCreateTime = date('Y-m-d H:i:s', $val['iCreateTime']);
            $str_explode .= '<tr>
								<td align="left">' . $sRealName . '</td>
								<td align="left">' . $iMediaType . '</td>
								<td align="left">' . $sMediaName . '</td>
								<td align="left">' . $sOpenName . '</td>
								<td align="left">' . $iFollowerNum . '</td>
								<td align="left"><img src="' . $sFollowerImg . '" /></td>
								<td align="left"><img src="' . $sAvatar . '" /></td>
								<td align="left"><img src="' . $sQRCode . '" /></td>
								<td align="left">' . $iPrice5 . '</td>
								<td align="left">' . $iPrice6 . '</td>
								<td align="left">' . $iPrice7 . '</td>
								<td align="left">' . $iPrice8 . '</td>
								<td align="left">' . $iReadNum . '</td>
								<td align="left">' . $iScore . '</td>
								<td align="left">' . $iRecommendLevel . '</td>
								<td align="left">' . $iAttribute . '</td>
								<td align="left">' . $sWxLink . '</td>
								<td align="left">' . $iVerifyState . '</td>
								<td align="left">' . $sIntroduction . '</td>
								<td align="left">' . $sTypeInfo . '</td>
								<td align="left">' . $sCooperateLevelInfo . '</td>
								<td align="left">' . $sCertifiedText . '</td>
								<td align="left">' . $iClickNumber . '</td>
								<td align="left">' . $iChoiceNumber . '</td>
								<td align="left">' . $iArticleNumber . '</td>
								<td align="left">' . $iZambiaNumber . '</td>
								<td align="left">' . $aCategory . '</td>
								<td align="left">' . $aCity . '</td>
								<td align="left">' . $aCricle . '</td>
								<td align="left">' . $aTag . '</td>
							</tr>';
        }
        $str_explode .= '</table>';
        $str_explode .= "</body></html>";
        echo $str_explode;
    }
예제 #2
0
파일: Finances.php 프로젝트: pancke/yyaf
    /**
     * 导出
     */
    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_Finance::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>
								<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) {
            $row = Model_User::getDetail($val['iUserID']);
            $sUserRealName = isset($row) && $row['sRealName'] != '' ? $row['sRealName'] : '';
            $iPayment = isset($val['iPayment']) && $val['iPayment'] == '1' ? '收入' : '支出';
            $iSource = '';
            if ($val['iSource'] == '1') {
                $iSource = '自主充值';
            } elseif ($val['iSource'] == '2') {
                $iSource = '付款充值';
            } elseif ($val['iSource'] == '3') {
                $iSource = '拒单退款';
            } elseif ($val['iSource'] == '4') {
                $iSource = '取现';
            } elseif ($val['iSource'] == '5') {
                $iSource = '广告费用';
            }
            $sRealName = $val['sRealName'];
            $iPayType = '';
            if ($val['iPayType'] == '1') {
                $iPayType = '支付宝';
            } elseif ($val['iPayType'] == '2') {
                $iPayType = '微信';
            } elseif ($val['iPayType'] == '3') {
                $iPayType = '银行卡';
            }
            $iPayMoney = $val['iPayMoney'];
            $iUserMoney = $val['iUserMoney'];
            $sOpenName = $val['sOpenName'];
            $sBankName = $val['sBankName'];
            $sPayAccount = $val['sPayAccount'];
            $iPayStatus = isset($val['iPayStatus']) && $val['iPayStatus'] == '0' ? '未支付' : '已支付';
            $sPayOrder = $val['sPayOrder'];
            $sRemark = $val['sRemark'];
            $iCreateTime = date('Y-m-d H:i:s', $val['iCreateTime']);
            $str_explode .= '<tr>
								<td align="left">' . $sUserRealName . '</td>
								<td align="left">' . $iPayment . '</td>
								<td align="left">' . $iSource . '</td>
								<td align="left">' . $sRealName . '</td>
								<td align="left">' . $iPayType . '</td>
								<td align="left">' . $iPayMoney . '</td>
								<td align="left">' . $iUserMoney . '</td>
								<td align="left">' . $sOpenName . '</td>
								<td align="left">' . $sBankName . '</td>
								<td align="left">' . $sPayAccount . '</td>
								<td align="left">' . $iPayStatus . '</td>
								<td align="left">' . $sPayOrder . '</td>
								<td align="left">' . $sRemark . '</td>
								<td align="left">' . $iCreateTime . '</td>
							</tr>';
        }
        $str_explode .= '</table>';
        $str_explode .= "</body></html>";
        echo $str_explode;
    }
예제 #3
0
파일: Adsh.php 프로젝트: pancke/yyaf
    /**
     * 导出
     */
    public function explodeAction()
    {
        $uWhere = array();
        $aParam = $this->getParams();
        $userid = '';
        if (!empty($aParam['sUserRealName'])) {
            $uWhere['sRealName LIKE'] = '%' . $aParam['sUserRealName'] . '%';
            $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['sAdName']) && $aParam['sAdName'] != '') {
            $aWhere['sAdName LIKE'] = '%' . $aParam['sAdName'] . '%';
        }
        if (!empty($aParam['iMediaType']) && $aParam['iMediaType'] != '') {
            $aWhere['iMediaType'] = $aParam['iMediaType'];
        }
        if (!empty($aParam['iAdType']) && $aParam['iAdType'] != '') {
            $aWhere['iAdType'] = $aParam['iAdType'];
        }
        if (!empty($aParam['iPayStatus']) && $aParam['iPayStatus'] != '') {
            $aWhere['iPayStatus'] = $aParam['iPayStatus'];
        }
        if (!empty($aParam['iStatus']) && $aParam['iStatus'] != '') {
            $aWhere['iStatus'] = $aParam['iStatus'];
        } else {
            $aWhere['iStatus IN'] = '1,2,3,4,5';
        }
        $aList = Model_Ad::getAll(array('where', $aWhere));
        foreach ($aList['aList'] as $key => $val) {
            //媒体类型
            if ($val['iMediaType'] == '1') {
                $aList['aList'][$key]['iMediaType'] = '公众号';
            } elseif ($val['iMediaType'] == '2') {
                $aList['aList'][$key]['iMediaType'] = '朋友圈';
            } elseif ($val['iMediaType'] == '3') {
                $aList['aList'][$key]['iMediaType'] = '新浪微博';
            } elseif ($val['iMediaType'] == '4') {
                $aList['aList'][$key]['iMediaType'] = '新闻论坛';
            }
            //广告类型
            if ($val['iAdType'] == '1') {
                $aList['aList'][$key]['iAdType'] = '硬广';
            } elseif ($val['iAdType'] == '2') {
                $aList['aList'][$key]['iAdType'] = '软广';
            } elseif ($val['iAdType'] == '3') {
                $aList['aList'][$key]['iAdType'] = '全部';
            }
            //支付状态
            if ($val['iPayStatus'] == '0') {
                $aList['aList'][$key]['iPayStatus'] = '未付款';
            } elseif ($val['iPayStatus'] == '1') {
                $aList['aList'][$key]['iPayStatus'] = '已付款';
            }
            //状态
            if ($val['iStatus'] == '1') {
                $aList['aList'][$key]['iStatus'] = '待审核';
            } elseif ($val['iStatus'] == '2') {
                $aList['aList'][$key]['iStatus'] = '审核通过';
            } elseif ($val['iStatus'] == '3') {
                $aList['aList'][$key]['iStatus'] = '审核未通过';
            } elseif ($val['iStatus'] == '4') {
                $aList['aList'][$key]['iStatus'] = '完成';
            } elseif ($val['iStatus'] == '5') {
                $aList['aList'][$key]['iStatus'] = '全未填写完成';
            }
            //城市
            if ($val['sCityID'] != '') {
                $data_City = Model_City::getAll(array('where' => array('iCityID IN' => $val['sCityID'])));
                $sCityID = '';
                if (count($data_City) > 0) {
                    foreach ($data_City as $val_City) {
                        $sCityID .= ',' . $val_City['sCityName'];
                    }
                }
                $aList['aList'][$key]['sCityID'] = $sCityID;
            }
            //媒体分类
            if ($val['sCatID'] != '') {
                $data_Cat = Model_Domain::getAll(array('where' => array('iAutoID IN' => $val['sCatID'])));
                $sCatID = '';
                if (count($data_Cat) > 0) {
                    foreach ($data_Cat as $val_City) {
                        $sCatID .= ',' . $val_City['sName'];
                    }
                }
                $aList['aList'][$key]['sCatID'] = $sCatID;
            }
            //资源广告内容
            $rowAd = array();
            if ($val['iMediaType'] == Model_Media::TYPE_WEIXIN) {
                $rowAd = Model_AdWeixin::getDetail($val['iAdID']);
                $iPosID = $rowAd['iAdPos'];
            } elseif ($val['iMediaType'] == Model_Media::TYPE_FRIEND) {
                $rowAd = Model_AdFriend::getDetail($val['iAdID']);
                $iPosID = $rowAd['iAdPos'];
            } elseif ($val['iMediaType'] == Model_Media::TYPE_WEIBO) {
                $rowAd = Model_AdWeibo::getDetail($val['iAdID']);
                $iPosID = $rowAd['iAdPos'];
            } elseif ($val['iMediaType'] == Model_Media::TYPE_NEWS) {
                $rowAd = Model_AdNews::getDetail($val['iAdID']);
                $iPosID = $rowAd['iAdPos'];
            }
            $aList['aList'][$key]['Media'] = $rowAd;
            //广告位
            $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' => '直发报价'));
            if ($val['iMediaType'] != '') {
                $iPos = $aTitle[$val['iMediaType']][$iPosID];
                $aList['aList'][$key]['sPos'] = $iPos;
            }
        }
        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>
								<th scope="col">总价</th>
								<th scope="col">支付状态</th>
								<th scope="col">状态</th>
								<th scope="col">时间</th>
							</tr>';
        foreach ($aList as $key => $val) {
            $row = Model_User::getDetail($val['iUserID']);
            $sUserRealName = isset($row) && $row['sRealName'] != '' ? $row['sRealName'] : '';
            $iCreateTime = date('Y-m-d H:i:s', $val['iCreateTime']);
            $iPlanTime = isset($val['iPlanTime']) && $val['iPlanTime'] != '' ? date('Y-m-d H:i:s', $val['iPlanTime']) : '';
            $str_explode .= '<tr>
								<td align="left">' . $sUserRealName . '</td>
								<td align="left">' . $val['sAdName'] . '</td>
								<td align="left">' . $val['iPlanMinMoney'] . '</td>
								<td align="left">' . $val['iPlanMaxMoney'] . '</td>
								<td align="left">' . $val['iPlanTime'] . '</td>
								<td align="left">' . $val['iMediaType'] . '</td>
								<td align="left">' . $val['iAdType'] . '</td>
								<td align="left">' . $val['sCatID'] . '</td>
								<td align="left">' . $val['sCityID'] . '</td>
								<td align="left">' . $val['iTotalMoney'] . '</td>
								<td align="left">' . $val['iPayStatus'] . '</td>
								<td align="left">' . $val['iStatus'] . '</td>
								<td align="left">' . $iCreateTime . '</td>
							</tr>';
        }
        $str_explode .= '</table>';
        $str_explode .= "</body></html>";
        echo $str_explode;
    }
예제 #4
0
파일: Member.php 프로젝트: pancke/yyaf
 /**
  * 用户修改
  */
 public function editAction()
 {
     if ($this->_request->isPost()) {
         $aUser = $this->_checkData('update');
         if (empty($aUser)) {
             return null;
         }
         $aUser['iUserID'] = intval($this->getParam('iUserID'));
         $aOldUser = Model_User::getDetail($aUser['iUserID']);
         if (empty($aOldUser)) {
             return $this->showMsg('用户不存在!', false);
         }
         if ($aOldUser['sEmail'] != $aUser['sEmail'] && $aOldUser['iStatus'] > 0) {
             if (Model_User::getUserByEmail($aUser['sEmail'])) {
                 return $this->showMsg('用户已经存在!', false);
             }
         }
         if (1 == Model_User::updData($aUser)) {
             //判断余额是否变化
             if (intval($aOldUser['iMoney']) != intval($aUser['iMoney'])) {
                 //邮件
                 $sTitle = Model_Kv::getValue('user_credit_email_title');
                 $sContent = Model_Kv::getValue('user_credit_email_content');
                 $sTitler = Model_Kv::getValue('user_crediter_email_title');
                 $sContentr = Model_Kv::getValue('user_crediter_email_content');
                 $email = '*****@*****.**';
                 $Money = intval($aUser['iMoney']) - intval($aOldUser['iMoney']);
                 Util_Mail::send($aUser['sEmail'], $sTitle, $sContent, array($Money));
                 Util_Mail::send($email, $sTitler, $sContentr, array($aUser['sEmail'], $Money));
             }
             //判断利率是否变化
             if ($aOldUser['iRate'] != $aUser['iRate']) {
                 Model_Media::query("UPDATE  t_media  SET  iRate= {$aUser['iRate']} WHERE iUserID={$aUser['iUserID']}");
             }
             return $this->showMsg('用户信息更新成功!', true);
         } else {
             return $this->showMsg('用户信息更新失败!', false);
         }
     } else {
         $iUserID = intval($this->getParam('id'));
         $aUser = Model_User::getDetail($iUserID);
         $this->assign('aUser', $aUser);
         $this->assign('aBusiness', Model_Domain::getPairDomain(Model_Domain::TYPE_CO_INDUSTRY));
         //行业
     }
 }
예제 #5
0
파일: Mcenter.php 프로젝트: pancke/yyaf
 /**
  * 修改密码
  */
 public function chgpwdAction()
 {
     if ($this->isPost()) {
         $aParam = $this->getParams();
         $aErr = array();
         if (empty($aParam['sNewPassword']) || !Util_Validate::isLength($aParam['sNewPassword'], 6, 12)) {
             $aErr['sNewPassword'] = '******';
         }
         if ($aParam['sNewPassword'] != $aParam['sRePassword']) {
             $aErr['sRePassword'] = '******';
         }
         $aUser = Model_User::getDetail($this->aCurrUser['iUserID']);
         if (Model_User::makePassword($aParam['sOldPassword']) != $aUser['sPassword']) {
             $aErr['sOldPassword'] = '******';
         }
         if (!empty($aErr)) {
             return $this->showMsg($aErr, false);
         }
         $sNewPassword = Model_User::makePassword($aParam['sNewPassword']);
         Model_User::updData(array('sPassword' => $sNewPassword, 'iUserID' => $aUser['iUserID']));
         return $this->showMsg('登录密码修改成功!', true);
     } else {
         $this->assign('iTabID', 3);
         $this->setMeta('mcenter_page', array('sTitle' => '自媒体中心 - 修改登录密码'));
     }
 }
예제 #6
0
파일: Ad.php 프로젝트: pancke/yyaf
 /**
  * 支付详情
  */
 public function wpayAction()
 {
     $iAdID = intval($this->getParam('id'));
     $aAd = Model_Ad::getDetail($iAdID);
     if (empty($aAd) || $aAd['iUserID'] != $this->aCurrUser['iUserID']) {
         return $this->show404();
     }
     if ($aAd['iTotalMoney'] == 0) {
         return $this->show404('订单价格不能为0!');
     }
     $aUser = Model_User::getDetail($this->aCurrUser['iUserID']);
     $this->assign('aAd', $aAd);
     $this->assign('aUser', $aUser);
     $this->assign('sTopMenu', 'aadd');
     $this->setMeta('ad_add', array('sTitle' => '添加推广计划 - 支付详情'));
 }
예제 #7
0
파일: Mediaorder.php 프로젝트: pancke/yyaf
    /**
     * 导出
     */
    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>
								<td align="left">' . $sEmail . '</td>
								<td align="left">' . $aAd['sAdName'] . '</td>
								<td align="left">' . $sMediaName . '</td>
								<td align="left">' . $iPos . '</td>
								<td align="left">' . $iMoney . '</td>
								<td align="left">' . $iPlanTime . '</td>
								<td align="left">' . $iPayStatusName . '</td>
								<td align="left">' . $iStatusName . '</td>
								<td align="left">' . $iCreateTime . '</td>
							</tr>';
        }
        $str_explode .= '</table>';
        $str_explode .= "</body></html>";
        echo $str_explode;
    }
예제 #8
0
파일: Credit.php 프로젝트: pancke/yyaf
 /**
  * 用户修改
  */
 public function editAction()
 {
     if ($this->_request->isPost()) {
         $aUser = $this->_checkData('update');
         if (empty($aUser)) {
             return null;
         }
         $aUser['iUserID'] = intval($this->getParam('iUserID'));
         $aOldUser = Model_User::getDetail($aUser['iUserID']);
         if (empty($aOldUser)) {
             return $this->showMsg('用户不存在!', false);
         }
         if ($aOldUser['sEmail'] != $aUser['sEmail'] && $aOldUser['iStatus'] > 0) {
             if (Model_User::getUserByEmail($aUser['sEmail'])) {
                 return $this->showMsg('用户已经存在!', false);
             }
         }
         if (1 == Model_User::updData($aUser)) {
             return $this->showMsg('用户信息更新成功!', true);
         } else {
             return $this->showMsg('用户信息更新失败!', false);
         }
     } else {
         $iUserID = intval($this->getParam('id'));
         $aUser = Model_User::getDetail($iUserID);
         $this->assign('aUser', $aUser);
         $this->assign('aBusiness', Model_Domain::getPairDomain(Model_Domain::TYPE_CO_INDUSTRY));
         //行业
     }
 }
예제 #9
0
파일: Media.php 프로젝트: pancke/yyaf
 /**
  * 发布成功
  */
 public function addokAction()
 {
     $iMediaID = (int) $this->getParam('id');
     $aMedia = Model_Media::getDetail($iMediaID);
     if (empty($iMediaID)) {
         return $this->show404();
     }
     if (empty($aMedia)) {
         return $this->show404($aMedia['']);
     }
     $aUser = Model_User::getDetail($aMedia['iUserID']);
     $title = Model_Kv::getValue('media_go_email_title');
     $content = Model_Kv::getValue('media_go_email_content');
     $eamil1 = '*****@*****.**';
     $eamil2 = '*****@*****.**';
     Util_Mail::send($eamil1, $title, $content, array($aUser['sEmail'], $aMedia['sMediaName']));
     Util_Mail::send($eamil2, $title, $content, array($aUser['sEmail'], $aMedia['sMediaName']));
     $aType = Model_Media::$aType;
     $this->assign('sType', $aType[$aMedia['iMediaType']]);
     $this->assign('aMedia', $aMedia);
     $this->assign('sTopMenu', 'madd');
     $this->setMeta('media_add', array('sTitle' => '添加媒体 - 发布成功'));
 }
예제 #10
0
파일: Pay.php 프로젝트: pancke/yyaf
 public function successAction()
 {
     $iOrderID = $this->getParam('id');
     $aData = Model_Finance::getDetail($iOrderID);
     $aUser = Model_User::getDetail($aData['iUserID']);
     //支付成功发送邮件到公司媒介专员
     $sTitle = Model_Kv::getValue('tixing_zhifu_email_title');
     $sContent = Model_Kv::getValue('tixing_zhifu_email_content');
     $email = '*****@*****.**';
     Util_Mail::send($email, $sTitle, $sContent, array($aUser['sEmail'], $aData['iPayMoney']));
     $this->assign('aData', $aData);
 }
예제 #11
0
파일: Acenter.php 프로젝트: pancke/yyaf
 /**
  * 投放完成(结算)
  * 
  * @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);
 }
예제 #12
0
파일: Finance.php 프로젝트: pancke/yyaf
 /**
  * 充值
  * 
  * @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;
 }
예제 #13
0
파일: User.php 프로젝트: pancke/yyaf
 /**
  * 首次发布广告或自媒体
  */
 public function firstAction()
 {
     $iUserID = (int) $this->getParam('id');
     $aUser = Model_User::getDetail($iUserID);
     if (empty($aUser) || $aUser['iFirst'] >= 3) {
         return $this->showMsg('已处理', true);
     }
     Model_User::updData(array('iUserID' => $iUserID, 'iFirst' => 3));
     return $this->showMsg('已处理', true);
 }