Beispiel #1
0
 /**
  * 4.1得到还车地国家名称
  * @params json json_params(location_id)
  * @return  json
  * url:/index.php?r=CarrentalApi/rc/DropOffCountryListByLocationIdRQ&json_params={"location_id":"1124991"}
  */
 public function actionDropOffCountryListByLocationIdRQ()
 {
     $json_params = Yii::app()->request->getParam('json_params');
     //客户端请求的json参数
     $Redis = YiiRedis::getInstance();
     $redisKey = 'country_dropOff_' . md5($json_params);
     if ($Redis->hGet('currental_area', $redisKey)) {
         $Rs = $Redis->hGet('currental_area', $redisKey);
     } else {
         $Rs = RcManager::DropOffCountryListByLocationIdRQ($json_params);
         $Rs_array = json_decode($Rs, true);
         if ($Rs_array['status']) {
             $Redis->hSet('currental_area', $redisKey, $Rs);
         }
     }
     echo $Rs;
 }