In the model I registered a getter of the number of ads
public function getAdscount() { return $this->hasMany(Ads::className(), ['user_id' => 'id'])->where('name<>"tmp"')->count(); } How to implement sorting by this field in the gridview?
In the model I registered a getter of the number of ads
public function getAdscount() { return $this->hasMany(Ads::className(), ['user_id' => 'id'])->where('name<>"tmp"')->count(); } How to implement sorting by this field in the gridview?
Source: https://ru.stackoverflow.com/questions/536753/
All Articles