Browse Source

报销列表

shish 2 năm trước cách đây
mục cha
commit
7bd2543d6e
1 tập tin đã thay đổi với 27 bổ sung1 xóa
  1. 27 1
      app-ghs/controllers/ExpendController.php

+ 27 - 1
app-ghs/controllers/ExpendController.php

@@ -4,6 +4,7 @@ namespace ghs\controllers;
 
 use bizGhs\expend\classes\ExpendClass;
 use bizGhs\shop\classes\MainClass;
+use bizGhs\shop\classes\ShopAdminClass;
 use bizGhs\shop\classes\ShopMoneyClass;
 use common\components\dict;
 use common\components\noticeUtil;
@@ -13,7 +14,32 @@ use Yii;
 class ExpendController extends BaseController
 {
 
-    //类型
+    //待报销人员列表和金额 ssh 20240308
+    public function actionUnBxList()
+    {
+        ini_set('memory_limit', '2045M');
+        set_time_limit(0);
+        $list = ExpendClass::getAllByCondition(['mainId' => $this->mainId, 'bx' => 0], null, '*', null);
+        $arr = [];
+        if (!empty($list)) {
+            foreach ($list as $expend) {
+                $staffId = $expend['staffId'] ?? 0;
+                $amount = $expend['amount'] ?? 0;
+                $staffName = $expend['staffName'] ?? '';
+                if (isset($arr[$staffId])) {
+                    $arr[$staffId]['amount'] = bcadd($arr[$staffId]['amount'], $amount);
+                    $arr[$staffId]['num'] = bcadd($arr[$staffId]['num'], 1);
+                } else {
+                    $arr[$staffId]['amount'] = $amount;
+                    $arr[$staffId]['staffName'] = $staffName;
+                    $arr[$staffId]['num'] = 1;
+                }
+            }
+        }
+        util::success(['list' => $arr]);
+    }
+
+    //类型列表 ssh 20240308
     public function actionGetTypeList()
     {
         $list = dict::getDict('expendTypeMap');