Цитата (maruo @ 31.03.2016 - 15:04) |
lottery?select_all&_=1459430263100 с 302 ошибкой |
http://example.com/lottery?select_all&_=1459430263100то в $_SERVER['REQUEST_URI'] будет /lottery?select_all&_=1459430263100, соответственно и $controller_name = "lottery?select_all&_=1459430263100"
cache:falseдобаляет числа.
class Controller_lottery extends Controller{
function Action_index(){
$model = new Model_lottery();
$view = new View();
$view->generate('lottery');
}
function Action_selectall(){
$model = new Model_lottery();
$view = new View();
$view->generate('lottery',$model->get_data_sort_all());
}
}
echo json_encode($model->get_data_sort_all());
exit;
class Model_lottery extends Model {
public function get_data_sort_game($get_param){
include_once"connect_bd.php";
$sort_game = mysqli_real_escape_string($link,$get_param);
$full_query = mysqli_query($link,"SELECT l.lot_id,l.name_item,l.rare_item,l.price_item,l.price_ticket,
l.count_tickets,l.sort_item,l.lot_status,l.img, COUNT(s.lot_id) as count
FROM lottery l
LEFT JOIN start_lot s ON s.lot_id = l.lot_id
WHERE sort_item='$sort_game'
AND lot_status = 1
GROUP BY l.lot_id
LIMIT 50
")
OR die (mysqli_error($link));
while($result_query = mysqli_fetch_assoc($full_query)) {
$data[] = $result_query;
}
return $data;
}
public function get_data_sort_all(){
include_once"connect_bd.php";
$full_query = mysqli_query($link,"SELECT l.lot_id,l.name_item,l.rare_item,l.price_item,l.price_ticket,
l.count_tickets,l.sort_item,l.lot_status,l.img, COUNT(s.lot_id) as count
FROM lottery l
LEFT JOIN start_lot s ON s.lot_id = l.lot_id
WHERE lot_status = 1
GROUP BY l.lot_id
LIMIT 50
")
OR die (mysqli_error($link));
while ($result_query = mysqli_fetch_assoc($full_query)) {
$data[] = $result_query;
}
return $data;
}
}