|
|
@@ -103,6 +103,14 @@ class PurchaseController extends BaseController
|
|
|
$orderSn = $get['orderSn'] ?? 0;
|
|
|
$info = PurchaseClass::getByCondition(['orderSn' => $orderSn], true);
|
|
|
PurchaseService::valid($info, $this->shopId);
|
|
|
+
|
|
|
+ if ($info->status == 5) {
|
|
|
+ util::fail('订单已取消');
|
|
|
+ }
|
|
|
+ if ($info->status == 1) {
|
|
|
+ util::fail('订单不是待付款状态');
|
|
|
+ }
|
|
|
+
|
|
|
$ghsId = $info->ghsId;
|
|
|
$ghs = GhsClass::getGhsInfo($ghsId);
|
|
|
$customId = $ghs['customId'] ?? 0;
|
|
|
@@ -150,6 +158,12 @@ class PurchaseController extends BaseController
|
|
|
if (empty($info)) {
|
|
|
util::fail('没有找到采购单');
|
|
|
}
|
|
|
+ if ($info->status == 5) {
|
|
|
+ util::fail('订单已取消');
|
|
|
+ }
|
|
|
+ if ($info->status == 1) {
|
|
|
+ util::fail('订单不是待付款状态');
|
|
|
+ }
|
|
|
PurchaseService::valid($info, $this->shopId);
|
|
|
$connection = Yii::$app->db;//事务处理
|
|
|
$transaction = $connection->beginTransaction();
|
|
|
@@ -238,6 +252,12 @@ class PurchaseController extends BaseController
|
|
|
if (empty($order)) {
|
|
|
util::fail('订单号无效');
|
|
|
}
|
|
|
+ if ($order->status == 5) {
|
|
|
+ util::fail('订单已取消');
|
|
|
+ }
|
|
|
+ if ($order->status == 1) {
|
|
|
+ util::fail('订单不是待付款状态');
|
|
|
+ }
|
|
|
$id = $order->id;
|
|
|
$order->changePrice = 2;
|
|
|
$order->save();
|