git 6 lat temu
rodzic
commit
61c93f0eaf
1 zmienionych plików z 33 dodań i 66 usunięć
  1. 33 66
      Home/Lib/Action/ApiAction.class.php

+ 33 - 66
Home/Lib/Action/ApiAction.class.php

@@ -85,7 +85,7 @@ class ApiAction extends Action {
  
 	public  function reportPreSelectPlate(  ){
 		header('Access-Control-Allow-Origin:*');
-		$data = json_decode( file_get_contents("php://input") ,true);
+		$data = $_POST;
 		//验证需要字段是否存在
 		$appid = $data['AppId'];
 		if(!$appid){
@@ -201,7 +201,7 @@ class ApiAction extends Action {
  
 	public  function reportPersonalOrderInfo(  ){
 		header('Access-Control-Allow-Origin:*');
-		$data = json_decode( file_get_contents("php://input") ,true);
+		$data = $_POST;
 		$appid = $data['AppId'];
 		if(!$appid){
 			json_fail('AppId不存在!');
@@ -257,21 +257,12 @@ class ApiAction extends Action {
 		//检测车牌是否存在
 		if(!$data['LicensePlate']){
 			$data = array(
-					'ID' => create_guid(),
-					'FullName' => $data['FullName'],
-					'Sex' => $data['Sex'],
-					'UserPhone' => $data['UserPhone'],
-					'IdCard' => $data['IdCard'],
-					'DetailedAdd' => $data['DetailedAdd'],
-					'PlaceId' => $data['PlaceId'],
-					'InstallDate' => $data['InstallDate'],
-					'OrderType' => $data['OrderType'],
-					'OpenId' => $data['OpenId'],
-					'OrderNumber' => $ordernumber,
-					'OrderStatus' => 0,
-					'AddTime' => date('Y-m-d H:i:s'),
-					'EffectiveDate' => date("Y-m-d",strtotime("+".C('WJW.DELIVERY_TIME')." day")),
-					'ExpireDate' => date("Y-m-d",strtotime("+".(C('WJW.DELIVERY_TIME')+C('WJW.EXPIRATION_DATE'))." day")),
+					$data['ID'] => create_guid(),
+					$data['OrderNumber'] => $ordernumber,
+					$data['OrderStatus'] => 0,
+					$data['AddTime'] => date('Y-m-d H:i:s'),
+					$data['EffectiveDate'] => date("Y-m-d",strtotime("+".C('WJW.DELIVERY_TIME')." day")),
+					$data['ExpireDate'] => date("Y-m-d",strtotime("+".(C('WJW.DELIVERY_TIME')+C('WJW.EXPIRATION_DATE'))." day")),
 				);
 			$res = M('jms_order')->createAdd($data);
 			if(!$res){
@@ -284,22 +275,13 @@ class ApiAction extends Action {
 			//判断订单状态,过期重新开户
 			if(!$order_num){
 				$data = array(
-					'ID' => create_guid(),
-					'FullName' => $data['FullName'],
-					'Sex' => $data['Sex'],
-					'UserPhone' => $data['UserPhone'],
-					'IdCard' => $data['IdCard'],
-					'DetailedAdd' => $data['DetailedAdd'],
-					'PlaceId' => $data['PlaceId'],
-					'InstallDate' => $data['InstallDate'],
-					'OrderType' => $data['OrderType'],
-					'OpenId' => $data['OpenId'],
-					'OrderNumber' => $ordernumber,
-					'OrderStatus' => 0,
-					'AddTime' => date('Y-m-d H:i:s'),
-					'LicensePlate' => $data['LicensePlate'],
-					'EffectiveDate' => date("Y-m-d",strtotime("+".C('WJW.DELIVERY_TIME')." day")),
-					'ExpireDate' => date("Y-m-d",strtotime("+".(C('WJW.DELIVERY_TIME')+C('WJW.EXPIRATION_DATE'))." day")),
+					$data['ID'] => create_guid(),
+					$data['OrderNumber'] => $ordernumber,
+					$data['OrderStatus'] => 0,
+					$data['AddTime'] => date('Y-m-d H:i:s'),
+					$data['LicensePlate'] => $data['LicensePlate'],
+					$data['EffectiveDate'] => date("Y-m-d",strtotime("+".C('WJW.DELIVERY_TIME')." day")),
+					$data['ExpireDate'] => date("Y-m-d",strtotime("+".(C('WJW.DELIVERY_TIME')+C('WJW.EXPIRATION_DATE'))." day")),
 				);
 				$res = M('jms_order')->createAdd($data);
 				if(!$res){
@@ -350,7 +332,7 @@ class ApiAction extends Action {
  
 	public  function reportCompanyOrderInfo(  ){
 		header('Access-Control-Allow-Origin:*');
-		$data = json_decode( file_get_contents("php://input") ,true);
+		$data = $_POST;
 		$appid = $data['AppId'];
 		if(!$appid){
 			json_fail('AppId不存在!');
@@ -399,22 +381,14 @@ class ApiAction extends Action {
 		$ordernumber = $this->setOrderNumber();
 		//检测车牌是否存在
 		if(!$data['LicensePlate']){
-			$data = array(
-					'ID' => create_guid(),
-					'FullName' => $data['FullName'],
-					'Sex' => $data['Sex'],
-					'UserPhone' => $data['UserPhone'],
-					'IdCard' => $data['IdCard'],
-					'DetailedAdd' => $data['DetailedAdd'],
-					'PlaceId' => $data['PlaceId'],
-					'InstallDate' => date('Y-m-d'),
-					'OrderType' => 2,
-					'CompanyId' => $data['CompanyId'],
-					'OrderNumber' => $ordernumber,
-					'OrderStatus' => 0,
-					'AddTime' => date('Y-m-d H:i:s'),
-					'EffectiveDate' => date("Y-m-d",strtotime("+".C('WJW.DELIVERY_TIME')." day")),
-					'ExpireDate' => date("Y-m-d",strtotime("+".(C('WJW.DELIVERY_TIME')+C('WJW.EXPIRATION_DATE'))." day")),
+					$data['ID'] => create_guid(),
+					$data['InstallDate'] => date('Y-m-d'),
+					$data['OrderType'] => 2,
+					$data['OrderNumber'] => $ordernumber,
+					$data['OrderStatus'] => 0,
+					$data['AddTime'] => date('Y-m-d H:i:s'),
+					$data['EffectiveDate'] => date("Y-m-d",strtotime("+".C('WJW.DELIVERY_TIME')." day")),
+					$data['ExpireDate'] => date("Y-m-d",strtotime("+".(C('WJW.DELIVERY_TIME')+C('WJW.EXPIRATION_DATE'))." day")),
 				);
 			$res = M('jms_order')->createAdd($data);
 			if(!$res){
@@ -427,22 +401,15 @@ class ApiAction extends Action {
 			//判断订单状态,过期重新开户
 			if(!$order_num){
 				$data = array(
-					'ID' => create_guid(),
-					'FullName' => $data['FullName'],
-					'Sex' => $data['Sex'],
-					'UserPhone' => $data['UserPhone'],
-					'IdCard' => $data['IdCard'],
-					'DetailedAdd' => $data['DetailedAdd'],
-					'PlaceId' => $data['PlaceId'],
-					'InstallDate' => date('Y-m-d'),
-					'OrderType' => 2,
-					'CompanyId' => $data['CompanyId'],
-					'OrderNumber' => $ordernumber,
-					'OrderStatus' => 0,
-					'AddTime' => date('Y-m-d H:i:s'),
-					'LicensePlate' => $data['LicensePlate'],
-					'EffectiveDate' => date("Y-m-d",strtotime("+".C('WJW.DELIVERY_TIME')." day")),
-					'ExpireDate' => date("Y-m-d",strtotime("+".(C('WJW.DELIVERY_TIME')+C('WJW.EXPIRATION_DATE'))." day")),
+					$data['ID'] => create_guid(),
+					$data['InstallDate'] => date('Y-m-d'),
+					$data['OrderType'] => 2,
+					$data['OrderNumber'] => $ordernumber,
+					$data['OrderStatus'] => 0,
+					$data['AddTime'] => date('Y-m-d H:i:s'),
+					$data['LicensePlate'] => $data['LicensePlate'],
+					$data['EffectiveDate'] => date("Y-m-d",strtotime("+".C('WJW.DELIVERY_TIME')." day")),
+					$data['ExpireDate'] => date("Y-m-d",strtotime("+".(C('WJW.DELIVERY_TIME')+C('WJW.EXPIRATION_DATE'))." day")),
 				);
 				$res = M('jms_order')->createAdd($data);
 				if(!$res){