0){ $where[] = ['type', '=', $type]; } $list = self::where('uid', $param->uid) ->where($where) ->withAttr('type', function ($value, $data) use ($type_conf) { return isset($type_conf[$value]) ? $type_conf[$value] : '未知类型'; }) ->order('id', 'desc') ->paginate($param->data['limit']) ->toArray(); // $history = self::where([ // ['uid', '=', $param->uid], // ['state', '=', 1] // ])->sum('money'); return $list['data']; return compact('list', 'history'); } public function getTeamMoneyLog($param){ $type_conf = config('type.money'); $list = self::where('uid', $param->uid) ->whereIn('type', [5,7]) ->withAttr('type', function ($value, $data) use ($type_conf) { return isset($type_conf[$value]) ? $type_conf[$value] : '未知类型'; }) ->order('id', 'desc') ->paginate($param->data['limit']) ->toArray(); // $history = self::where([ // ['uid', '=', $param->uid], // ['state', '=', 1] // ])->sum('money'); return $list['data']; } }