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


PHP D::querymainlog方法代碼示例

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


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

示例1: actionQueryFrontVehicleMaintenance

 /**
  * 養護周期查詢-查詢前市場車型養護知識
  */
 public function actionQueryFrontVehicleMaintenance()
 {
     //檢查參數
     if (!isset($_POST['vehicleID']) || empty($_POST['vehicleID'])) {
         exit;
     }
     $vehicleID = $_POST['vehicleID'];
     //前市場車輛養護周期查詢日誌參數
     $userID = Yii::app()->user->id;
     //車型參數信息
     $vehicleModel = RPCClient::call('VehicleService_queryMtcVehicleDetail', array('vehicleMtcID' => $vehicleID));
     //車型保養周期知識信息
     $maintenanceModel = RPCClient::call('MaintenanceService_queryFrontVehicleMaintenanceinfo', array('vehicleID' => $vehicleID));
     //車型保養項目信息
     $maintenanceItemModel = RPCClient::call('MaintenanceService_queryFrontVehicleMaintenanceIteminfo', array('vehicleID' => $vehicleID));
     //車輛保養項目展示結果計算
     $maintenceHead = array();
     $maintenceLeft = array();
     $maintenceBody = array();
     if ($maintenanceModel && $maintenanceItemModel && count($maintenanceItemModel) > 0) {
         //表格頭部
         $firstMileage = $maintenanceModel['FirstMileage'];
         $firstPeriod = $maintenanceModel['FirstPeriod'];
         $maintenceHead[0]['content'] = $firstMileage . "km/<br />" . $firstPeriod . "個月";
         $maintenceHead[0]['mileage'] = $firstMileage;
         $maintenceHead[0]['period'] = $firstPeriod;
         $secondMileage = $maintenanceModel['SecondMileage'];
         $secondPeriod = $maintenanceModel['SecondPeriod'];
         $intervalMileage = $maintenanceModel['IntervalMileage'];
         $intervalPeriod = $maintenanceModel['IntervalPeriod'];
         $mileageCount = $secondMileage;
         $periodCount = $secondPeriod;
         $headNum = 1;
         while ($mileageCount <= 200000 && $periodCount <= 120) {
             $maintenceHead[$headNum]['content'] = $mileageCount . "km/<br />" . $periodCount . "個月";
             $maintenceHead[$headNum]['mileage'] = $mileageCount;
             $maintenceHead[$headNum]['period'] = $periodCount;
             $mileageCount += $intervalMileage;
             $periodCount += $intervalPeriod;
             $headNum++;
         }
         //表格中部
         for ($i = 0; $i < count($maintenanceItemModel); $i++) {
             $maintenceLeft[] = $maintenanceItemModel[$i]['ItemName'];
             $mileage = $maintenanceItemModel[$i]['Mileage'];
             $period = $maintenanceItemModel[$i]['Period'];
             $desc = $maintenanceItemModel[$i]['Desc'];
             $inFirst = $maintenanceItemModel[$i]['InFirst'];
             $inSecond = $maintenanceItemModel[$i]['InSecond'];
             if ($inFirst == '1') {
                 $maintenceBody[$i][0] = $desc;
             }
             if ($inSecond == '1') {
                 $maintenceBody[$i][1] = $desc;
             }
             for ($j = 2; $j < count($maintenceHead); $j++) {
                 if (empty($mileage) || empty($period)) {
                     $maintenceBody[$i][$j] = "";
                 } else {
                     if ($maintenceHead[$j]['mileage'] % $mileage == 0 || $maintenceHead[$j]['period'] % $period == 0) {
                         $maintenceBody[$i][$j] = $desc;
                     } else {
                         $maintenceBody[$i][$j] = "";
                     }
                 }
             }
         }
         //組合數據
         $maintenanceItem = array('head' => $maintenceHead, 'left' => $maintenceLeft, 'body' => $maintenceBody);
     }
     //車型易損件更換知識信息
     $wearpartModel = RPCClient::call('MaintenanceService_queryFrontVehicleWearpartinfo', array('vehicleID' => $vehicleID));
     //養護周期查詢日誌
     $logmantenanceinfo = array('vehicleID' => $vehicleID, 'userID' => $userID);
     try {
         $url = Yii::app()->controller->getRoute();
         //把ID轉換成對應的車型主組,子組
         $params['main'] = D::querymainlog($vehicleID);
         //插入mongo日誌
         $oper = F::getoperation($url, $info == '前市場車型查詢', $params);
     } catch (Exception $ex) {
     }
     RPCClient::call('LogService_logUserQueryMaintenance', $logmantenanceinfo);
     //返回信息數組
     $model = array('vehicleID' => $vehicleID, 'vehicle' => $vehicleModel, 'maintenanceModel' => $maintenanceModel, 'maintenanceItem' => $maintenanceItem, 'wearpartModel' => $wearpartModel);
     //返回頁麵
     $this->renderPartial('info', $model);
 }
開發者ID:zwq,項目名稱:unpei,代碼行數:91,代碼來源:MaintenanceController.php


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