Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6671505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:23:47+00:00 2026-05-26T03:23:47+00:00

In my project, i am using a cgridview to show records corresponding to the

  • 0

In my project, i am using a cgridview to show records corresponding to the user. name the model i am using is SupplierResponseMaster. this model have a relation to another model
named AccountsCorporate and the relation is 'corporate' => array(self::BELONGS_TO, 'AccountsCorporate', 'corporate_id'),. the search function is

public function search()
    {
        $criteria = new CDbCriteria;

        $criteria->compare('id', $this->id, true);
        $criteria->compare('survey_id', $this->survey_id, true);
        $criteria->compare('corporate_id', $this->corporate_id, true);
        $criteria->compare('user_id', $this->user_id, true);
        $criteria->compare('status', $this->status, true);
        $criteria->compare('common_notes', $this->common_notes, true);
        $criteria->compare('system_rank', $this->system_rank, true);
        $criteria->compare('request_coordinator_rank', $this->request_coordinator_rank, true);
        $criteria->compare('is_short_listed', $this->is_short_listed);
        $criteria->compare('short_listed_date', $this->short_listed_date, true);
        $criteria->compare('is_awarded', $this->is_awarded);
        $criteria->compare('awarded_date', $this->awarded_date, true);
        $criteria->compare('created_by', $this->created_by, true);
        $criteria->compare('created_date', $this->created_date, true);
        $criteria->compare('modified_by', $this->modified_by, true);
        $criteria->compare('modified_date', $this->modified_date, true);

        return new CActiveDataProvider($this, array(
                    'criteria' => $criteria,
                ));
    }

in my grid view, i need to load the details from the model using the search(or any alternative method) function for the given user_id and also get the corporate name from the AccountCorporate model using the corporate_id. please help me to find a solution for this.

thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:23:48+00:00Added an answer on May 26, 2026 at 3:23 am

    Create new relation user with 'user' => array(self::BELONGS_TO, 'Users', 'user_id'),
    then to get the details of user for grid you can use $data->user->name

    For corporate name use $data->corporate->name

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a Conceptual Model in my project using a table in my
I have a test project using MbUnit and TestDriven.Net. If I right-click on an
I have a project using ASIHTTP to multi download files from a site when
I have a webforms project using EF codefirst to persist data. I'd like to
I am using Asp.net/C# in my project , i have a requirement where in
I have a project using Gradle as the build tool and I have to
In my project, i am using cgridview to display some information and using the
I am using the ASP.NET3.5 gridview control in a new project. My problem is
I've got a project using Maven 2 as the build tool. Now I am
I'm building a project using a GNU tool chain and everything works fine until

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.