',$last_month]; break; case 3: $last_month = date("Y-m-01 H:i:s", time()); $new_month = date("Y-m-d H:i:s", time()); $where['UpdateTime'] = ['<',$new_month]; $wheres['UpdateTime'] = ['>',$last_month]; break; } return $this->field('ScoreTypeName,ScoreValue,RestAmount1,RestAmount2,UpdateTime') ->where(['UserId' => $user_id]) ->where($where) ->where($wheres) ->order('Id desc') ->fetchAll(); } }