Giter Club home page Giter Club logo

activerecord's People

Contributors

rsanchez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

ericatkinson

activerecord's Issues

Field values equal to each other

Great plugin!

Here's my code and you'll see what I'm trying to do:

where:exp_forms_entries.member_id="{member_id}"
or_where:exp_forms_entries.fid_1010="exp_forms_entries.fentry_id"

It's evaluating the "exp_forms_entries.fentry_id" as a string, rather than database field. Possible?

member_id and userdata

Grmbl, memberdata is parsed late in the template parsing process.
Making it difficult to fetch profile fields for the current user.

Added the following in build_query

foreach ($params as $method => $value)
{
    // some normally late parsed variables that are already in the session
    if($value=="{member_id}") $value = $this->EE->session->userdata['member_id'];

Is there a way to handle multiple joins?

I've tried

join[a]="channel_data"
...
join[b]="relationships"

Thinking it might work like where, but this doesn't do any of the joins. I've also tried

join="channel_data"
...
join="relationships"

But this only does the last join.

Pulling most popular purchased item

Trying to use the code below to grab the most popular purchased item from my cart throb purchased items channel but only shows titles alphabetically. Any ideas of what I may be doing wrong? Thanks!

{exp:activerecord select="title, COUNT(title) AS score" from="channel_titles" where:channel_id="9" group_by="title" sort_by="score desc"}

  • {title}
  • {/exp:activerecord}

    Conditional join?

    Hey,

    This is more of a support ticket than an issue. I'm running a query that includes a join. As expected, when the join value is blank, it does not return a result. However, in my case, I want to allow that -- so that the rest of the values in the result still populate. Could you maybe provide me some advice? I'm using the exp:vz_tabular:csv to get this data into a csv. The join that is needed to be 'conditional' or 'eligible to be blank' is join:exp_channel_titles="exp_forms_entries.fid_1068 = exp_channel_titles.entry_id". Thanks for any advice!

    {exp:vz_tabular:csv filename="wart-haig-waiver.csv"}
      {exp:activerecord
        select="
          exp_forms_entries.fentry_id,
          exp_channel_data.field_id_696,
          exp_channel_data.field_id_679,
          exp_forms_entries.fid_1037,
          exp_forms_entries.fid_1031,
          exp_forms_entries.date,
          exp_forms_entries.fid_1128,
          exp_forms_entries.fid_1029,
          exp_channel_data.field_id_718,
          exp_channel_data.field_id_719,
          exp_channel_data.field_id_452,
          exp_forms_entries.fid_1068,
          exp_forms_entries.fid_1037,
          exp_channel_titles.title,
          exp_members.email"
        from="exp_forms_entries"
        where:exp_forms_entries.form_id="37"
        join:exp_channel_titles="exp_forms_entries.fid_1068 = exp_channel_titles.entry_id"
        join:exp_channel_data="exp_forms_entries.fid_1067 = exp_channel_data.entry_id"
        join:exp_members="exp_forms_entries.member_id = exp_members.member_id"
        {if get:event_name != ''}
          like:exp_forms_entries.fid_1037="{get:event_name}"
        {/if}
      }
        [col Entry ID]{fentry_id}[/col]
        [col Date]{date format="%m-%d-%y"}[/col]
        [col First Name]{field_id_718}[/col]
        [col Last Name]{field_id_719}[/col]
        [col Email]{email}[/col]
        [col Address]{field_id_696}[/col]
        [col Role]participant[/col]
        [col Sport]{fid_1031}[/col]
        [col Gender]{field_id_679}[/col]
        [col Grad Year]{field_id_452}[/col]
        [col Coach's Name]{fid_1128}[/col]
        [col Coach's Email]{fid_1129}[/col]
        [col Club]{title}[/col]
        [col Event]{fid_1037}[/col]
      {/exp:activerecord}
    {/exp:vz_tabular:csv}
    

    Parse a hash

    Hey Ron,

    I'm wondering if there's a way to parse an array / hash. I'm working with VZ Address field, with my goal to separate the output as individual fields. Sample:

    {"street":"583 King of Prussia Rd","street_2":"","city":"Radnor","region":"PA","postal_code":"19087","country":"US"}

    *ignore* parsing of stash tags when passed within query params

    Please ignore - my mistake!


    Following not working (not parsing stash tag variable)

    {exp:activerecord
    select="author_id, title"
    distinct="yes"
    from="channel_titles"
    where="channel_id = 15"
    where_in:author_id="{exp:stash:get name='stash_product_authors'}"}

    Excerpts

    I have tried to use a variety of Excerpt plugins on the results and they all get ignored .. one example one http://devot-ee.com/add-ons/excerpt1

    {exp:excerpt limit="5"}{description}{/exp:excerpt}

    It will just output the full description. Is there anything in this plugin that would prevent tags being used like this?

    Thanks!

    no_results is not working.

    Hello,

    I do not know if i am doing something wrong or it is the plugin. I set this query up so it will return no records so i can test the no_results. When i run it, my web page is blank. Here is the code;
    {exp:activerecord
    select="channel_titles.title AS title,
    channel_titles.url_title AS article_link,
    channel_data.field_id_6 AS authors,
    channel_data.field_id_7 AS conference,
    channel_data.field_id_8 AS keywords,
    channel_data.field_id_10 AS file,
    channel_data.field_id_16 AS article_type,
    channel_data.field_id_19 AS external_link,
    channel_data.field_id_15 AS publication,
    channel_data.field_id_21 AS year,
    channel_data.field_id_17 AS volume,
    channel_data.field_id_13 AS issue,
    channel_data.field_id_14 AS pages"
    protect_select="yes"
    from="channel_titles"
    left_join:channel_data="channel_data.entry_id = channel_titles.entry_id"
    where:channel_data.channel_id = "7"
    limit="15"
    paginate="both"

    }
    {!-- this parses exactly like a query module tag --}

    {if no_results}<h3>We're sorry, but we couldn't find anything for you. Please try another search.</h3>{/if}
    
        {title}<br />
        {article_link}<br />
        {authors}<br />
        {conference}<br />
        {keywords}<br />
        {file}<br />
        {article_type}<br />
        {external_link}<br />
        {publication}<br />
        {year}<br />
        {volume}<br />
        {issue}<br />
        {pages}<br /><br />
        {paginate}
        <p>Page {current_page} of {total_pages} pages {pagination_links}</p>
        {/paginate}
    

    {/exp:activerecord}

    Since there is no id of 7 here, where:channel_data.channel_id = "7", I should get no records back and trigger the no_results if statement but it does not. I just get a blank page.

    Regards,
    Stephen

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google โค๏ธ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.