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(); return $list['data']; return compact('list', 'history'); } /** * 团队奖金 * @param $param * @return array * @throws \think\db\exception\DbException */ public function getTeamMoneyLog($param){ $type_conf = config('type.money'); $total = self::where('uid', $param->uid) ->whereIn('type', [5,7])->sum('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(); return ['list'=>$list['data'],'total'=>$total,'count'=>$list['total']]; } }