devolp 2 лет назад
Родитель
Сommit
3d91cd606f
3 измененных файлов с 23 добавлено и 7 удалено
  1. 5 1
      app/admin/logic/MoneyLogLogic.php
  2. 9 6
      app/admin/logic/ScoreLogLogic.php
  3. 9 0
      config/type.php

+ 5 - 1
app/admin/logic/MoneyLogLogic.php

@@ -70,7 +70,11 @@ class MoneyLogLogic
         $list = $model
             ->where($where)
             ->withAttr('type', function ($value, $data) use ($type_conf) {
-                return $type_conf[$value];
+                if (array_key_exists($value, $type_conf)) {
+                    return $type_conf[$value];
+                }
+                return '';
+
             })
             ->withAttr('money', function ($value, $data) {
                 if ($data['state'] == 2)

+ 9 - 6
app/admin/logic/ScoreLogLogic.php

@@ -50,26 +50,29 @@ class ScoreLogLogic
 
     /**
      * 积分记录
-     * @param mixed $page
-     * @param mixed $limit
-     * @param mixed $where
+     * @param  $page
+     * @param  $limit
+     * @param  $where
      * @param array $sort
      * @return array
      * @throws \think\db\exception\DataNotFoundException
      * @throws \think\db\exception\DbException
      * @throws \think\db\exception\ModelNotFoundException
      */
-    public static function scoreLog(mixed $page, mixed $limit, mixed $where, array $sort)
+    public static function scoreLog($page, $limit, $where, $sort)
     {
         $model     = new ScoreLogModel();
         $count     = $model
             ->where($where)
             ->count();
-        $type_conf = config('type.score');
+        $type_conf = config('type.scoreAll');
         $list      = $model
             ->where($where)
             ->withAttr('type', function ($value, $data) use ($type_conf) {
-                return $type_conf[$value];
+                if (array_key_exists($value, $type_conf)) {
+                    return $type_conf[$value];
+                }
+                return '';
             })
             ->withAttr('score', function ($value, $data) {
                 if ($data['state'] == 2)

+ 9 - 0
config/type.php

@@ -44,6 +44,15 @@ return [
         3=>'买商品送积分',
         4=>'提现多次返回'
     ],
+    'scoreAll'=>[
+        1=>'预约福袋',
+        2=>'预约福袋空盒退回',
+        3=>'买商品送积分',
+        4=>'提现多次返回',
+        6=>'兑换商品',
+        12=>'平台充补',
+        13=>'平台扣除',
+    ],
     // 利润
     'profit'=>[
         1=>'回收福袋利润',