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


PHP CommonUtil::generateImgUrl方法代碼示例

本文整理匯總了PHP中CommonUtil::generateImgUrl方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonUtil::generateImgUrl方法的具體用法?PHP CommonUtil::generateImgUrl怎麽用?PHP CommonUtil::generateImgUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CommonUtil的用法示例。


在下文中一共展示了CommonUtil::generateImgUrl方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getFrontModelDetail

 /**
  * 查詢車型的詳細信息
  */
 public function getFrontModelDetail($modelId)
 {
     //車型參數信息
     $modelParams = RPCClient::call('VehicleService_queryFrontModelParams', array('modelId' => $modelId));
     //車型圖片信息
     $modelPics = RPCClient::call('VehicleService_queryFrontModelPics', array('modelId' => $modelId));
     //圖片URL加密
     $imageencode = Yii::app()->params['imgencode'];
     $imgserver = Yii::app()->params['imgserver'];
     for ($i = 0; $i < count($modelPics); $i++) {
         $vehiclepic = $modelPics[$i]['originPic'];
         $originpic = CommonUtil::generateImgUrl($vehiclepic, $imgserver, 'vehicle_origin');
         $smallpic = CommonUtil::generateImgUrl($vehiclepic, $imgserver, 'vehicle_small');
         $thumbpic = CommonUtil::generateImgUrl($vehiclepic, $imgserver, 'vehicle_thumb');
         $orgnsignurl = CommonUtil::encodeImgUrl($originpic, $imageencode);
         $smallsignurl = CommonUtil::encodeImgUrl($smallpic, $imageencode);
         $thumbsignurl = CommonUtil::encodeImgUrl($thumbpic, $imageencode);
         $modelPics[$i]['originPic'] = $orgnsignurl;
         $modelPics[$i]['smallPic'] = $smallsignurl;
         $modelPics[$i]['thumbPic'] = $thumbsignurl;
     }
     //返回信息數組
     $modelDetail = array('modelId' => $modelId, 'modelParams' => $modelParams, 'modelPics' => $modelPics);
     return $modelDetail;
 }
開發者ID:zwq,項目名稱:unpei,代碼行數:28,代碼來源:VehicleController.php

示例2: actionGetmodeldetail

 public function actionGetmodeldetail()
 {
     $modelId = Yii::app()->request->getParam('modelId');
     if (!$modelId) {
         return '';
         exit;
     }
     if ($modelId == 'all') {
         $modelPics = '';
     } else {
         //車型圖片信息
         $sql = "select a.picId, a.title as picTitle, a.caption as picCaption, " . " concat(TRIM('/' from picPath),'/',a.picName) as originPic" . " from {{front_pic}} a right join {{front_model_pic}} b on a.picid = b.picid" . " where b.modelid =" . $modelId . " order by a.picNo";
         $modelParams = Yii::app()->jpdb->createCommand($sql)->queryAll();
         //圖片URL加密
         $modelPics = $modelParams;
         $imageencode = Yii::app()->params['imgencode'];
         $imgserver = Yii::app()->params['imgserver'];
         for ($i = 0; $i < count($modelPics); $i++) {
             $vehiclepic = $modelPics[$i]['originPic'];
             $originpic = CommonUtil::generateImgUrl($vehiclepic, $imgserver, 'vehicle_origin');
             $smallpic = CommonUtil::generateImgUrl($vehiclepic, $imgserver, 'vehicle_small');
             $thumbpic = CommonUtil::generateImgUrl($vehiclepic, $imgserver, 'vehicle_thumb');
             $orgnsignurl = CommonUtil::encodeImgUrl($originpic, $imageencode);
             $smallsignurl = CommonUtil::encodeImgUrl($smallpic, $imageencode);
             $thumbsignurl = CommonUtil::encodeImgUrl($thumbpic, $imageencode);
             $modelPics[$i]['originPic'] = $orgnsignurl;
             $modelPics[$i]['smallPic'] = $smallsignurl;
             $modelPics[$i]['thumbPic'] = $thumbsignurl;
         }
     }
     if (empty($modelPics)) {
         exit;
     }
     $this->renderPartial('imagesgallery', array('car_picture' => $modelPics));
 }
開發者ID:zwq,項目名稱:unpei,代碼行數:35,代碼來源:HomeController.php

示例3: actionPartInfo

 /**
  * 配件詳細信息
  * 
  */
 public function actionPartInfo()
 {
     if (!isset($_POST['modelId']) || empty($_POST['modelId'])) {
         Yii::app()->end();
     }
     if (!isset($_POST['partId']) || empty($_POST['partId'])) {
         Yii::app()->end();
     }
     $userId = Yii::app()->user->id;
     $modelId = $_POST['modelId'];
     $partId = $_POST['partId'];
     //用戶車型權限檢查,如果沒有權限則不返回相應的信息
     //$hasPerm = Yii::app()->user->checkPermission(array('vehicleEpcID'=>$vehicleEpcID));
     $hasPerm = true;
     if (!$hasPerm) {
         $this->renderPartial('partsdetail', array('hasPerm' => false));
         Yii::app()->end();
     }
     //查詢配件詳情
     $partInfo = RPCClient::call('PartsService_queryPartInfo', array('partId' => $partId));
     //圖片URL加密
     if ($partInfo) {
         $picture = trim($partInfo['picture'], '/');
         $imgserver = Yii::app()->params['imgserver'];
         $imageencode = Yii::app()->params['imgencode'];
         $originpic = CommonUtil::generateImgUrl($picture, $imgserver, 'parts');
         $signurl = CommonUtil::encodeImgUrl($originpic, $imageencode);
         $partInfo['picture'] = $signurl;
     }
     try {
         $url = Yii::app()->controller->getRoute();
         //把ID轉換成對應的車型主組,子組
         $params['partsdetail'] = D::querypvdetailog($modelId, $partId);
         //插入mongo日誌
         $oper = F::getoperation($url, $info == null, $params);
         //epc查詢日誌
         $loginfoArr = array('userId' => $userId, 'querytype' => 1, 'modelId' => $modelId, 'partId' => $partId);
         RPCClient::call('LogService_logQueryEpc', $loginfoArr);
     } catch (Exception $e) {
     }
     $this->renderPartial('partsdetail', array('part' => $partInfo, 'hasPerm' => true));
 }
開發者ID:zwq,項目名稱:unpei,代碼行數:46,代碼來源:PartsController.php


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