更新若干功能
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user