I have a long array,for the pagination! I did a "premium" for the users. Now I want to sort array by the premium. My array:
array:8 [▼
0 => array:34 [▼
"id" => 10
"id_user" => "2"
"vehicletype" => "car"
"make" => "AMC"
"model" => "Encore"
"age" => "2017-01-14"
"body" => "4"
"price" => "94650"
"vrt_price" => "102850"
"vrt_date" => "2017-01-14"
"condition" => "2"
"mileage" => "12"
"booth_space" => "1"
"doors" => "1"
"seat" => "14"
"eng_size" => "1"
"eng_hp" => "0.75"
"eng_kw" => "1"
"fuel" => "LPG"
"trans" => "Semi-Au"
"desc" => "133333333333333333333333333333333333333333333333333333333133333333333333333333333333333333333333333333333333333333"
"extras" => "2"
"created_at" => "2017-01-14 14:13:00"
"finish_at" => "2017-02-14 14:13:00"
"updated_at" => null
"premium_g1" => null
"g1_start_at" => null
"g1_finish_at" => null
"premium_g2" => null
"g2_start_at" => null
"g2_finish_at" => null
"extras_title" => array:1 [▶]
"user_name" => "Szabolcs996"
"images" => array:1 [▶]
]
1 => array:34 [▶]
2 => array:34 [▶]
3 => array:34 [▶]
4 => array:34 [▶]
5 => array:34 [▶]
6 => array:34 [▼
"id" => 5
"id_user" => "2"
"vehicletype" => "car"
"make" => "Aston Martin"
"model" => "Rapide"
"age" => "2017-01-14"
"body" => "5"
"price" => "4800"
"vrt_price" => "1550"
"vrt_date" => "2017-01-14"
"condition" => "2"
"mileage" => "450"
"booth_space" => "1550"
"doors" => "15"
"seat" => "4"
"eng_size" => "5"
"eng_hp" => "79.5"
"eng_kw" => "106"
"fuel" => "LPG"
"trans" => "Automatic"
"desc" => "1234567891111111111111111111111111111111111111111111111111111115asssssssssssssssssssssss"
"extras" => "2,4,7,8"
"created_at" => "2017-01-14 12:43:19"
"finish_at" => "2017-02-14 12:43:19"
"updated_at" => "2017-01-22 17:04:08"
"premium_g1" => "123"
"g1_start_at" => "2017-01-23 09:45:58"
"g1_finish_at" => "2017-02-04 09:45:58"
"premium_g2" => "22"
"g2_start_at" => "2017-01-23 09:45:58"
"g2_finish_at" => "2017-02-22 09:45:58"
"extras_title" => array:4 [▶]
"user_name" => "Szabolcs996"
"images" => array:12 [▶]
]
7 => array:34 [▶]
]
So,that articles have premium_g2 value!
The important thing I not want to sort by MYSQL!
I have on every page 8 article. I want to mix the articles,like on every page every second/third articles to be the premium.
Thanks!