Home > Backend Development > PHP Tutorial > Yii2 converts the ID query of some fields into names in the columns of the DynaGrid plug-in, causing the query statement to be executed multiple times.

Yii2 converts the ID query of some fields into names in the columns of the DynaGrid plug-in, causing the query statement to be executed multiple times.

WBOY
Release: 2016-08-10 09:07:20
Original
1206 people have browsed it

Yii2 converts the ID query of some fields into names in the columns of the DynaGrid plug-in, causing the query statement to be executed multiple times.][1]

As shown in the picture above, if written like this, the query statement in value will be executed multiple times, resulting in slower access speed.
What should be done to solve this problem?
That’s what I think, but I don’t know if it’s right.
1. I directly group all the required data in the controller and then transfer it to DynaGrid for output, but this will involve related queries of multiple tables. There may be 6 or 7 tables. Will it cause access speed problems? ? Besides this method, is there any better solution?
2. When doing step 1, there are some fields that are not in the table, such as "company id". How can I transfer them to DynaGrid for output?

Reply content:

Yii2 converts the ID query of some fields into names in the columns of the DynaGrid plug-in, causing the query statement to be executed multiple times.][1]

As shown in the picture above, if written like this, the query statement in value will be executed multiple times, resulting in slower access speed.
What should be done to solve this problem?
That’s what I think, but I don’t know if it’s right.
1. I directly group all the required data in the controller and then transfer it to DynaGrid for output, but this will involve related queries of multiple tables. There may be 6 or 7 tables. Will it cause access speed problems? ? Besides this method, is there any better solution?
2. When doing step 1, there are some fields that are not in the table, such as "company id". How can I transfer them to DynaGrid for output?

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template