Ver Fonte

订单与刮刮卡表字段

shish há 6 anos atrás
pai
commit
4b86d4759c

+ 2 - 2
app/client/controllers/OrderController.php

@@ -208,7 +208,7 @@ class OrderController extends BaseController
 		$newParams = json_decode($jsApiParameters, true);
 		//已请求微信不能修改价格
 		$updateData = [];
-		$updateData['modPriceStatus'] = 1;
+		$updateData['modPrice'] = 0;
 		if (empty($order['deadline'])) {
 			$updateData['deadline'] = $expireTime;
 		}
@@ -242,7 +242,7 @@ class OrderController extends BaseController
 			util::fail('请填写正确的金额');
 		}
 		//微信支付订单提交不能修改价格
-		$post['modPriceStatus'] = $this->isWeixin ? 1 : 0;
+		$post['modPrice'] = $this->isWeixin ? 0 : 1;
 		$post['sourceType'] = $sourceType;
 		$order = OrderService::addOrder($post);
 		$orderId = $order['id'];

+ 6 - 6
app/saas/controllers/OrderController.php

@@ -157,7 +157,7 @@ class OrderController extends PlatformController
         }
         //已付款 或 微信中打开支付链接的,不可修改价格
         $status = $orderData['actPrice'] != $post['consumeAmount'] ? true : false;
-        if($orderData['modPriceStatus'] == 1 && $status){
+        if($orderData['modPrice'] == 0 && $status){
             util::failInfo('订单已锁定,不能修改价格');
         }else if($orderData['payStatus'] == 1 && $status){
             util::failInfo('订单已付款,不能修改价格');
@@ -219,11 +219,11 @@ class OrderController extends PlatformController
     	$actPrice	= isset($get['actPrice']) ? $get['actPrice'] : 10000;
     	$id  		= isset($get['id']) ? $get['id'] : 0;
     	$order		= xhOrderService::getById($id, $this->merchantId);
-    	/*if($order['merchantId'] != $this->merchantId){
-    		util::failInfo('非法访问');
-    	}*/
-    	if($order['modPriceStatus'] == 1){
-    		util::failInfo('订单已锁定,不能修改价格');
+    	if($order['merchantId'] != $this->merchantId){
+    		util::fail('您没有权限操作此订单');
+    	}
+    	if($order['modPrice'] == 0){
+    		util::fail('订单已锁定,不能修改价格');
     	}
     	$prePrice			= $order['actPrice'];
     	xhOrderService::updateById($id, ['actPrice' => $actPrice]);

+ 2 - 0
sql.txt

@@ -3,6 +3,8 @@ RENAME TABLE xhGuaGua TO xhGgk;
 RENAME TABLE xhGuaGuaAttend TO xhGgkAttend;
 RENAME TABLE xhGuaGuaPrize TO xhGgkPrize;
 RENAME TABLE xhGuaGuaWin TO xhGgkWin;
+ALTER TABLE xhOrder CHANGE `modPriceStatus` `modPrice` TINYINT NOT NULL DEFAULT 1 COMMENT '0不能修改价格 1可以修改';
+ALTER TABLE xhOrder DROP COLUMN `getCouponQrCode`;
 
 2019.12.15 shish 优惠券
 ALTER TABLE xhCoupon MODIFY `orderId` INT NOT NULL DEFAULT 0 COMMENT '优惠券使用的订单id';