示例#1
0
 public function actionGetCarOwnerInfo()
 {
     $type = $_GET['type'];
     $licencePlate = $_GET['licencePlate'];
     $address = $_GET['address'];
     $message = $_GET['message'];
     $result = CarMoveManager::getAllRecordByPlateStyleIdAndNum($type, $licencePlate);
     $car_move_info = new CarMoveinfo();
     $car_move_info->sms_code = '000000';
     $car_move_info->plate_num = $licencePlate;
     $car_move_info->car_address = $address;
     $car_move_info->message = $message;
     $cur_time = date('Y-m-d H:i:s', time());
     $car_move_info->time = date("Y-m-d H:i:s", strtotime($cur_time));
     if ($result != null) {
         $car_move_info->style_id = $result->plate_style_id;
         $car_move_info->car_owner_phone = $result->mobile_phone;
         $car_owner_info = array('status' => 0, 'message' => '成功获取车主信息,获得对方车主信息', 'data' => array(array('name' => $result->name, 'mobile_phone' => $result->mobile_phone)));
     } else {
         $car_owner_info = array('status' => 1, 'message' => '数据库中无车主 挪车请求失败', 'data' => array());
     }
     try {
         $ret = $car_move_info->save();
     } catch (Exception $ex) {
         echo "存储挪车记录失败" . $ex->getMessage();
     }
     echo CJSON::encode($car_owner_info);
 }