示例#1
0
$app->get('/shiningfloor/looks', function () use($app, $db) {
    $looks = array();
    //$query = $db->products()->group('product_look');
    $query = $db->looks()->order('look_name ASC');
    foreach ($query as $look) {
        if ($look['look_name'] != "") {
            $looks[] = $look['look_name'];
        }
    }
    $app->response()->header('content-type', 'application/json');
    echo json_encode(array('looks' => $looks));
});
$app->get('/shiningfloor/materials', function () use($app, $db) {
    $product_materials = array();
    // $query = $db->products()->group('product_material');
    $query = $db->materials()->order('material_name ASC');
    foreach ($query as $material) {
        if ($material['material_name'] != "") {
            $product_materials[] = $material['material_name'];
        }
    }
    $app->response()->header('content-type', 'application/json');
    echo json_encode(array('materials' => $product_materials));
});
$app->get('/shiningfloor/shapes', function () use($app, $db) {
    $product_shapes = array();
    // $query = $db->products()->group('product_material');
    $query = $db->shapes()->order('shape_name ASC');
    foreach ($query as $shape) {
        if ($shape['shape_name'] != "") {
            $product_shapes[] = $shape['shape_name'];