更新若干功能
Some checks failed
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
Tests / PHP 8.4 (push) Has been cancelled

This commit is contained in:
2026-08-20 19:16:49 +08:00
parent 72bc6502eb
commit 4ddf5e3c5f
48 changed files with 1908 additions and 18 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Service\business;
use App\BaseApp\BaseService;
use App\Models\business\ListModel;
use App\Models\business\OrderModel;
use App\Models\business\OrderPaymentModel;
use App\Models\business\WxUserModel;
@@ -188,6 +189,15 @@ class OrderService extends BaseService
$stat['auditing'] = OrderPaymentModel::where('deleted_at', 0)
->where('status', OrderPaymentModel::STATUS_AUDITING)
->count();
$stat['list_count'] = ListModel::where('deleted_at', 0)->count();
$stat['wx_user_count'] = WxUserModel::where('deleted_at', 0)->count();
$statusMap = [];
foreach ($stat['status'] as $row) {
$statusMap[(int) $row['status']] = (int) $row['count'];
}
$stat['unpaid'] = $statusMap[OrderModel::STATUS_UNPAID] ?? 0;
$stat['paid'] = $statusMap[OrderModel::STATUS_PAID] ?? 0;
$stat['shipped'] = $statusMap[OrderModel::STATUS_SHIPPED] ?? 0;
return $stat;
}
}