优化部分查询速度
This commit is contained in:
@@ -122,19 +122,27 @@ class DepartController extends BaseAdminController
|
||||
$p->where(['like','c.name',$city]);
|
||||
}]);
|
||||
}
|
||||
$this->field = [
|
||||
Store::class => [
|
||||
'id', 'plate_id', 'name', 'position', 'offical_seal', 'pic', 'contact', 'mobile', 'qr_code',
|
||||
'start_time', 'end_time',
|
||||
'drugstore_id', 'see_rate',
|
||||
'drugstore' => 'drugStore.name',
|
||||
'code','uid','supply'=>'admin.username',
|
||||
'province'=>'province.name',
|
||||
'city'=>'city.name',
|
||||
'province_id',
|
||||
'city_id','erp_id'
|
||||
]
|
||||
];
|
||||
if (empty(\Yii::$app->request->get('page'))) {
|
||||
$this->field = [
|
||||
Store::class => [
|
||||
'id', 'name'
|
||||
]
|
||||
];
|
||||
} else {
|
||||
$this->field = [
|
||||
Store::class => [
|
||||
'id', 'plate_id', 'name', 'position', 'offical_seal', 'pic', 'contact', 'mobile', 'qr_code',
|
||||
'start_time', 'end_time',
|
||||
'drugstore_id', 'see_rate',
|
||||
'drugstore' => 'drugStore.name',
|
||||
'code','uid','supply'=>'admin.username',
|
||||
'province'=>'province.name',
|
||||
'city'=>'city.name',
|
||||
'province_id',
|
||||
'city_id','erp_id'
|
||||
]
|
||||
];
|
||||
}
|
||||
return $this->create($query, $get);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user