| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <?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);
- //累计已结账,app上在使用此数值
- $totalAmount = ClearClass::sum(['ghsShopId' => $this->shopId, 'status' => 2, 'customId' => $customId], 'realPrice');
- $list['totalAmount'] = floatval($totalAmount);
- util::success($list);
- }
- }
|