mirror of
https://gitee.com/technical-laohu/mpay.git
synced 2025-09-21 03:06:39 +08:00
优化订单状态逻辑
This commit is contained in:
parent
2447ebd52d
commit
7a7f690e6e
@ -218,6 +218,9 @@ class PayController
|
|||||||
$path = '../runtime/order.json';
|
$path = '../runtime/order.json';
|
||||||
if ($is_user) {
|
if ($is_user) {
|
||||||
$orders = Order::scope('activeOrder')->field('id,pid,aid,cid')->select();
|
$orders = Order::scope('activeOrder')->field('id,pid,aid,cid')->select();
|
||||||
|
if (!file_exists($path)) {
|
||||||
|
file_put_contents($path, '[]');
|
||||||
|
}
|
||||||
$old_info = file_get_contents($path);
|
$old_info = file_get_contents($path);
|
||||||
$num = count($orders);
|
$num = count($orders);
|
||||||
if ($num > 0) {
|
if ($num > 0) {
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
header('content-type: application/json; charset=utf-8');
|
header('content-type: application/json; charset=utf-8');
|
||||||
$order = file_get_contents('../runtime/order.json');
|
$path = '../runtime/order.json';
|
||||||
echo $order;
|
if (!file_exists($path)) {
|
||||||
|
exit('{"code":3,"msg":"文件不存在"}');
|
||||||
|
} else {
|
||||||
|
exit(file_get_contents($path));
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user