|
|
@@ -0,0 +1,37 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace ghs\controllers;
|
|
|
+
|
|
|
+use bizGhs\clear\classes\ClearClass;
|
|
|
+use bizGhs\clear\services\ClearService;
|
|
|
+use bizGhs\custom\classes\CustomClass;
|
|
|
+use common\components\util;
|
|
|
+use Yii;
|
|
|
+
|
|
|
+class CheckOutController extends BaseController
|
|
|
+{
|
|
|
+
|
|
|
+ //客户的结帐记录 ssh 20241212
|
|
|
+ public function actionList()
|
|
|
+ {
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $where = [];
|
|
|
+ if (isset($get['status']) && is_numeric($get['status'])) {
|
|
|
+ $where['status'] = $get['status'];
|
|
|
+ }
|
|
|
+ $customId = $get['customId'] ?? 0;
|
|
|
+ if (!empty($customId)) {
|
|
|
+ $custom = CustomClass::getById($customId, true);
|
|
|
+ CustomClass::valid($custom, $this->shopId);
|
|
|
+ $where['customId'] = $customId;
|
|
|
+ }
|
|
|
+ $where['ghsShopId'] = $this->shopId ?? 0;
|
|
|
+ $list = ClearService::getClearList($where);
|
|
|
+
|
|
|
+ $totalAmount = ClearClass::sum(['ghsShopId' => $this->shopId, 'status' => 2, 'customId' => $customId], 'realPrice');
|
|
|
+ $list['totalAmount'] = floatval($totalAmount);
|
|
|
+
|
|
|
+ util::success($list);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|