?> </div> </div> <!--满意度评价--> <p class="txxx bor_back m-top10">满意度评价</p> <div class="bor_back "> <div class="satisfied "> <div class="jg-info float_l"> <div class="triangle-border2 tb-border2"></div> <div class="triangle-border2 tb-background2"></div> <div style="padding:35px 20px"> <?php $OrderInfo = PapOrder::model()->findByPK($OrderID); $OrganInfo = Organ::model()->findByPk($OrderInfo['SellerID']); $OrganPhoto = OrganPhoto::model()->find("OrganID =:organID", array(':organID' => $OrganInfo['ID'])); $xylevel = EvaluateService::getpets($OrganInfo['Grade']); if (empty($xylevel) || !$xylevel[0] || !$xylevel[1]) { $xylvstr = "<div class='xy-div' title='积分过低'><i class='seller-level0'></i></div>"; } else { $xylvstr = '<div class = "xy-div" title = "积分:' . $OrganInfo['Grade'] . '">' . str_repeat("<i class='seller-level" . $xylevel[0] . "'></i>", $xylevel[1]) . '</div>'; } ?> <div class="eav-jg-img float_l"><img src="<?php echo F::uploadUrl() . $OrganPhoto['Path']; ?> "></div> <div class="eav-jg-info float_l"> <p><b><?php echo $OrganInfo['OrganName']; ?> </b></p>
<?php //机构图片 //$goodsimg = OrganPhoto::model()->findAll("OrganID=:userID", array(":userID" => $organID)); //$imgUrl = $goodsimg[0]->Path; $goodsimg = Organ::model()->findByPk($organID); $imgUrl = $goodsimg->Logo; $oname = $goodsimg->OrganName; //好评统计 $goodsArr = EvaluateService::getevalgoods(array('OrganID' => $organID)); $goodsArr1 = EvaluateService::getevalgoods(array('OrganID' => $organID, 'm' => 1)); $goodsArr6 = EvaluateService::getevalgoods(array('OrganID' => $organID, 'm' => 6)); $goodsArr12 = EvaluateService::getevalgoods(array('OrganID' => $organID, 'm' => 12)); $total = $goodsArr[1] + $goodsArr[2] + $goodsArr[3]; $goodsscore = $goodsArr[1] - $goodsArr[3]; //信用等级 $xylevel = EvaluateService::getpets($goodsscore); if (empty($xylevel) || !$xylevel[0] || !$xylevel[1]) { $xylvstr = "<div class='xy-div' title='暂无'><i style='color:#888'>暂无</i></div>"; } else { $xylvstr = '<div class = "xy-div" title = "积分:' . $goodsscore . '">' . str_repeat("<i class='seller-level" . $xylevel[0] . "'></i>", $xylevel[1]) . '</div>'; } $total1 = $goodsArr1[1] + $goodsArr1[2] + $goodsArr1[3]; $total6 = $goodsArr6[1] + $goodsArr6[2] + $goodsArr6[3]; $total12 = $goodsArr12[1] + $goodsArr12[2] + $goodsArr12[3]; $praise = $total ? sprintf('%0.1f', $goodsArr[1] * 100 / $total) : 0; //综合评分 $fwitem = EvaluateService::getevainfo(2); $fwArr = EvaluateService::getevalscore(array('OrganID' => $organID)); $i = 0; $sum = 0; $ul1 = '<ul class = "s_one">';
public static function getOrganName($id, $type = 1) { $model = Organ::model()->findByPk($id); $grade = $model->Grade; //信用等级 $xylevel = EvaluateService::getpets($grade); if ($type == 2) { if (empty($xylevel) || !$xylevel[0] || !$xylevel[1]) { $str = "<div title='暂无' style='color:#888'>暂无</div>"; } else { $str = '<div title = "积分:' . $grade . '">' . str_repeat("<i class='seller-level" . $xylevel[0] . "'></i>", $xylevel[1]) . '</div>'; } return "<p class='eval_organ'><a href='" . Yii::app()->createUrl('servicer/uniondealer/detail', array('dealer' => $id)) . "' target='_blank'>" . $model->attributes['OrganName'] . "</a></p>" . "<div>{$str}</div>"; } else { if (empty($xylevel) || !$xylevel[0] || !$xylevel[1]) { $str = "<div title='暂无'>暂无</div>"; } else { $str = '<div title = "积分:' . $grade . '">' . str_repeat("<i class='buyer-level" . $xylevel[0] . "'></i>", $xylevel[1]) . '</div>'; } return "<p class='eval_organ'>" . $model->attributes['OrganName'] . "</p><div>{$str}</div>"; } }
public function actionGeteva() { $goodsid = $_GET['goodsid']; $organid = $_GET['organid']; $page = $_GET['page']; $criteria = new CDbCriteria(); //过滤有图片的评论 if ($_GET['status'] == 'pic') { $sql = "select Group_Concat(DISTINCT EvalID) as eval FROM `pap_evaluation_goods_image` where GoodsID={$goodsid}"; $res = Yii::app()->papdb->createCommand($sql)->queryRow(); if ($res && !is_null($res['eval'])) { $criteria->addCondition("ID in({$res['eval']})", "AND"); } else { $criteria->addCondition("ID in('')", "AND"); } } else { if ($_GET['status'] == 'good') { $criteria->addCondition("Status=1 ", "AND"); } else { if ($_GET['status'] == 'medium') { $criteria->addCondition("Status=2 ", "AND"); } else { if ($_GET['status'] == 'bad') { $criteria->addCondition("Status=3 ", "AND"); } } } } //评价有无内容过滤 if ($_GET['content'] == 'content') { $criteria->addCondition("BuyerToEvalRemark != '0' and BuyerToEvalRemark != '' ", "AND"); } //评价排序 if ($_GET['orderby'] == 'orderID') { $criteria->order = "id DESC"; } elseif ($_GET['orderby'] == 'ordertimeup') { $criteria->order = "CreateTime ASC"; } elseif ($_GET['orderby'] == 'ordertimedrop') { $criteria->order = "CreateTime DESC"; } $criteria->addCondition("t.GoodsID= " . $goodsid, "AND"); $criteria->addCondition("t.OrganID= " . $organid, "AND"); $criteria->addCondition("OrderID!=''", "AND"); // $criteria->select = 't.*'; // $criteria->join = "join pap_evaluation_goods_image b on t.ID=b.EvalID"; //分页 $count = PapEvaluationGoods::model()->count($criteria); $pages = new CPagination($count); $pages->pageSize = 5; $pages->applyLimit($criteria); $model = PapEvaluationGoods::model()->findAll($criteria); $data = array(); $zi = 1500; foreach ($model as $key => $value) { $data[$key]['BuyerToEvalRemark'] = !empty($value["BuyerToEvalRemark"]) ? $value["BuyerToEvalRemark"] : ''; $data[$key]['SellerToEvalRemark'] = $value["SellerToEvalRemark"]; $data[$key]['BCreateTime'] = date("Y-m-d H:i:s", $value["CreateTime"]); $data[$key]['UpdateTime'] = date('Y-m-d H:i:s', $value['UpdateTime']); $sql = "select MakeID,CarID,Year,ModelID from pap_order_goods where OrderID={$value['OrderID']} and GoodsID={$value['GoodsID']}"; $res = Yii::app()->papdb->createCommand($sql)->queryRow(); $carstr = MallService::getCarmodeltxt(array('make' => $res['MakeID'], 'series' => $res['CarID'], 'year' => $res['Year'], 'model' => $res['ModelID'])); $data[$key]['CarmodelText'] = $carstr ? $carstr : '无'; //获得图片 // $goodsimg = OrganPhoto::model()->findAll("OrganID=:userID", array(":userID" => $userID)); // $data[$key]['GoodsIMG'] = $goodsimg[0]->Path; switch ($value['Status']) { case '2': $data[$key]['Eval'] = '中评'; break; case '3': $data[$key]['Eval'] = '差评'; break; default: $data[$key]['Eval'] = '好评'; break; } $data[$key]['BuyerID'] = $value["BuyerID"]; $buyerinfo = Organ::model()->findByPk($value["BuyerID"]); $data[$key]['BuyerName'] = $buyerinfo->OrganName; $data[$key]['Grade'] = $buyerinfo->Grade; $data[$key]['zindex'] = $zi--; //信用等级 $xylevel = EvaluateService::getpets($data[$key]['Grade']); if (empty($xylevel) || !$xylevel[0] || !$xylevel[1]) { $data[$key]['Xylv'] = "<div title='积分:暂无' style='color:#888;text-indent:0px;float:left'>暂无</div>"; } else { $data[$key]['Xylv'] = '<div class="showlv" title = "积分:' . $data[$key]['Grade'] . '">' . str_repeat("<i class='buyer-level" . $xylevel[0] . "'></i>", $xylevel[1]) . '</div>'; } //获取评论图片 if ($value->image) { foreach ($value->image as $k => $v) { $data[$key]['Picture'][$k]['ImageUrl'] = $v['ImageUrl']; } } } $rs['rows'] = $data; //获得分页 $rs['page'] = $this->getPagination($count, $pages->pageSize, $page); echo json_encode($rs); yii::app()->end(); }
//var_dump($imgUrl);die; //获取买家信用统计 $items = EvaluateService::getevainfo(3); $tr = ''; if (!empty($items)) { foreach ($items as $k => $v) { $servicescore = EvaluateService::getevalservice(array('OrganID' => $organID, 'm' => $k)); $totalrow = $servicescore['3'] + $servicescore['2'] + $servicescore['1']; $tr .= "<p class='imain'><b class='c1'>{$v}</b><b>{$servicescore['3']}</b><b>{$servicescore['2']}</b><b>{$servicescore['1']}</b></p>"; } } $total = EvaluateService::getevalservice(array('OrganID' => $organID)); $totalall = $total['3'] + $total['2'] + $total['1']; $totalxy = $total['3'] - $total['1']; //信用等级 $xylevel = EvaluateService::getpets($totalxy); if (empty($xylevel) || !$xylevel[0] || !$xylevel[1]) { $levelstr = "<div title='暂无' style='color:#888'>暂无</div>"; } else { $levelstr = '<div title = "积分:' . $totalxy . '">' . str_repeat("<i class='buyer-level" . $xylevel[0] . "'></i>", $xylevel[1]) . '</div>'; } $praise = $totalall ? sprintf('%0.1f', $total['3'] * 100 / $totalall) : 0; $jdt = EvaluateService::getJdtCss($praise); $tr .= "<p class='imain last'><b class='c1'>总计</b><b>{$total['3']}</b><b>{$total['2']}</b><b>{$total['1']}</b></p>"; ?> <div class="main1"> <h3>我的信用管理</h3> <div class="infor1 fl"> <h4>信用信息</h4> <dl> <dt class="fl"><a><img src="<?php