|
|
@@ -99,25 +99,23 @@ class PurchaseController extends Controller
|
|
|
try {
|
|
|
$cg = PurchaseClass::getById($id, true);
|
|
|
$deadline = $cg->deadline ?? '';
|
|
|
-
|
|
|
- //if (!empty($deadline)) {
|
|
|
+ if (!empty($deadline)) {
|
|
|
$currentDead = date("Y-m-d H:i", strtotime($deadline));
|
|
|
$currentDeadTime = strtotime($currentDead);
|
|
|
$now = strtotime(date('Y-m-d H:i'));
|
|
|
//2分钟
|
|
|
$tow = 120;
|
|
|
$totalTime = $now + $tow;
|
|
|
- //if ($totalTime == $currentDeadTime) {
|
|
|
+ if ($totalTime == $currentDeadTime) {
|
|
|
$saleId = $cg->saleId ?? 0;
|
|
|
$order = OrderClass::getById($saleId, true);
|
|
|
if(!empty($order)){
|
|
|
$shopId = $order->shopId ?? 0;
|
|
|
ShopExtClass::beforeCancelPrint($shopId,$order);
|
|
|
}
|
|
|
- //}
|
|
|
- die;
|
|
|
- //}
|
|
|
- //$transaction->commit();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $transaction->commit();
|
|
|
} catch (\Exception $e) {
|
|
|
$transaction->rollBack();
|
|
|
$msg = $e->getMessage();
|