select posts.id, m1.meta_value as seo_title, m1.meta_value as seo_descr
from posts
join left meta_table as m1 on m1.post_id = posts.id and m1.meta_key = 'seo_title'
join left meta_table as m2 on m2.post_id = posts.id and m2.meta_key = 'seo_descr'
group by posts.id
<span class="{{$order->status_color}}">{{$order->status}}</span> // $order->status - это getStatusAttribute()
public function getStatusColorAttribute() {
switch($this->status) {
case 1: return '<span class="green">Новый</span>';
break;
case 3: return '<span class="blue">Выполнен</span>';
break;
case 4: return '<span class="red">Отказ</span>';
break;
....
}
}
public function getStatusAttribute()
{
if (status === 1) {
echo '<зелёный>Новый</зелёный>';
} elseif (status === 2) {
echo '<синий>Выполнен</синий>';
} elseif (status === 3) {
echo '<красный>Отказ</красный>';
} else {
echo 'Што?';
}
}
'rules' => [
'<param1>' => 'site/index',
'<param1>/<param2>' => 'site/index',
],
/********************/
public function actionIndex($param1=false,$param2=false)
{
return 'hello world - '.$param1.'/'.$param2;
}
а LIMIT 1 убери