shish 2 years ago
parent
commit
4bfdcd69f8
2 changed files with 9 additions and 1 deletions
  1. 8 0
      app-ghs/controllers/ExpendController.php
  2. 1 1
      common/components/dict.php

+ 8 - 0
app-ghs/controllers/ExpendController.php

@@ -142,6 +142,14 @@ class ExpendController extends BaseController
         $currentEndTime = $currentEndDate . ' 23:59:59';
         $where['addTime'] = ['between', [$currentStartTime, $currentEndTime]];
         $list = ExpendClass::getExpendList($where);
+        $map = dict::getDict('expendTypeMap');
+        if (!empty($list)) {
+            foreach ($list as $key => $val) {
+                $type = $val['type'] ?? 0;
+                $name = $map[$type] ?? '未命名';
+                $list[$key]['typeName'] = $name;
+            }
+        }
         util::success($list);
     }
 

+ 1 - 1
common/components/dict.php

@@ -469,7 +469,7 @@ class dict
             'qt' => 5,//其它
         ],
         'expendTypeMap' => [
-            0 => '店租', 1 => '水电', 2 => '物业', 3 => '伙食', 4 => '房租', 5 => '其它', 6 => '物品',
+            0 => '店租', 1 => '水电', 2 => '物业', 3 => '伙食', 4 => '房租', 5 => '其它', 6 => '物品', 7 => '办公用品'
         ],
         'expendTypeList' => [
             ['id' => 7, 'name' => '办公用品'],