skip to Main Content

SQL query for woocommerce

I built a woocommerce sql query to list all products with their important values. Here my query: SELECT p.ID, p.post_type as Art, p.post_title AS Produkt, p.post_excerpt AS Beschreibung, t.name AS Produzent, MAX(CASE WHEN pm1.meta_key = 'faktor' then pm1.meta_value ELSE NULL…

VIEW QUESTION

Can't update my inventory table with array laravel

I have an array list of data I want to update to the inventory table. $data['items'] = DB::table('inventory_items')->select('inventory_items.*') ->join('sorder_parts', 'inventory_items.id', 'sorder_parts.inventory_id') ->where('sorder_parts.sorder_id', '=', $id) ->selectraw('inventory_items.quantity - sorder_parts.quantity AS new_quantity') ->get()->toArray(); foreach ($data as $product_item) { $reduce_quantity = InventoryItem::updateOrCreate(['id' => $product_item['items']['id']],…

VIEW QUESTION
Back To Top
Search