public static function getTest($id,$lim){
$m = static::find()->all();
$massiv = [];
foreach ($m as $key) {
if(in_array($id,json_decode(json_encode($key['category']),true))){
$y = $key['id'];
array_push($massiv, $y);
}
}
return static::find()->where(['IN', 'id', $massiv])->orderBy(["id"=>SORT_DESC])->limit($lim)->all();
}