shish 1 년 전
부모
커밋
a5cf0e23ca
1개의 변경된 파일7개의 추가작업 그리고 3개의 파일을 삭제
  1. 7 3
      app-ghs/controllers/StatItemController.php

+ 7 - 3
app-ghs/controllers/StatItemController.php

@@ -68,9 +68,6 @@ class StatItemController extends BaseController
         $where['payTime'] = ['between', [$currentStartTime, $currentEndTime]];
 
         $staffId = $get['staffId'] ?? 0;
-        if (!empty($staffId)) {
-            $where['cgStaffId'] = $staffId;
-        }
 
         $list = OrderClass::getAllByCondition($where, null, '*');
         if (empty($list)) {
@@ -95,6 +92,13 @@ class StatItemController extends BaseController
                     $name = $productInfo[$productId]['name'] ?? '';
                     $py = $productInfo[$productId]['py'] ?? '';
 
+                    if (!empty($staffId)) {
+                        $currentCgStaffId = $productInfo[$productId]['cgStaffId'] ?? 0;
+                        if ($staffId != $currentCgStaffId) {
+                            continue;
+                        }
+                    }
+
                     $num = bcsub($item['xhNum'], $item['refundNum'], 2);
                     $unitPrice = $item['xhUnitPrice'] ?? 0;
                     $unitCost = $item['cost'] ?? 0;